PDA

View Full Version : shrinkWrap on Grid not working for width



abcdef
4 Apr 2012, 12:21 PM
I have a grid and I have tried configuring it with shrinkWrap: 3 as well as true. Height seems to be working, but width is not. Its rendering as width = 2px. Is there a known issue?

My grid looks like:



layout: 'fit',
forceFit: true,
preventHeader: true,
overflowX: 'auto',
overflowY: 'auto',
minHeight: 200,
minWidth: 200,
shrinkWrap: 3,
columns: [..]


Any ideas?

Additionally, I also noticed that with shrinkWrap, it does not honor the minHeight config. How can I set a minimum + maximum height as well as shrinkWrap?

scottmartin
4 Apr 2012, 1:41 PM
What is the look you are trying achieve?

Several notes:



layout: 'fit', // only useful for containers that have items
forceFit: true,
preventHeader: true, // depreciated, use header
overflowX: 'auto', // scrollbars are handled automatically, not needed
overflowY: 'auto', // same as above
minHeight: 200,
minWidth: 200,
shrinkWrap: 3,
columns: [..]


Scott

abcdef
4 Apr 2012, 2:37 PM
What is the look you are trying achieve?

Several notes:



layout: 'fit', // only useful for containers that have items
forceFit: true,
preventHeader: true, // depreciated, use header
overflowX: 'auto', // scrollbars are handled automatically, not needed
overflowY: 'auto', // same as above
minHeight: 200,
minWidth: 200,
shrinkWrap: 3,
columns: [..]


Scott

I need the grid to resize to fit its contents both width and height wise. I also need to constrain it to a certain max height and width, and preferably, I also need it to have a certain minimum height and width. How can I do so?

abcdef
5 Apr 2012, 1:38 PM
Any ideas here please?

scottmartin
5 Apr 2012, 2:20 PM
In reading your description ..


I need the grid to resize to fit its contents both width and height wise
When the browser window changes, the grid size changes?

Usually the view (columns,rows) fit the grid size, not the grid re-sizing based on the data.

Or are you talking about the rows of data in the grid to be dynamic based on the data in each cell.

Sorry for the confusion, but your description is still vague.

Regards,
Scott.

abcdef
5 Apr 2012, 3:03 PM
In reading your description ..


When the browser window changes, the grid size changes?

Usually the view (columns,rows) fit the grid size, not the grid re-sizing based on the data.

Or are you talking about the rows of data in the grid to be dynamic based on the data in each cell.

Sorry for the confusion, but your description is still vague.

Regards,
Scott.

Thanks for getting back to me!

I have a window that houses the grid using 'fit' layout. The grid itself uses the 'fit' layout with 'forceFit: true'.

When I don't pass any height or width to the grid, the grid renders with 2px width (I think this is from the borders), but it does render with the correct height (by correct height, I mean a height that is enough to show all the contents of the grid without scrolling).

When I pass a minWidth to the grid, it still renders with 2px width.

I have pass a width to the grid for it to render with that width.

In all the above, I have not specified any minHeight or height on the grid.

My question is whether there is a way that I can make sure that the grid also considers the width of the grid's contents as it considers the height of the contents?