I am using shrinkToFit = true property to fit the table with columns width(proportional sizing), in the mean time I also want to hide a column but does not want to change the width of the table. If shrinkTofit is set true, the table width also shrinks with the amount of the width of the hidden column. Let me give an example,
Configuration:
ShrinkToFit = true
Table width = 800,
Two columns exist:
ColumnA width=200,
ColumnB width=200
when jqgrid is constructed the widths will be calculated like that:
TableWidth = 800,
Width of ColumnA = 400,
Width of ColumnB = 400
When ColumnB is set to hidden,widths will be (normal behaviour):
table width=400
ColumnA width =400
My Desired Behaviour:
table width = 800
ColumnA width = 800
Is is possible to achieve this behaviour?
thanks in advance, Alper.
If I understand you correct you can just call setGridWidth
method one more time with the current grid width
and true
as the next (shrink
) parameter:
var myGrid = $("#list"),
width = myGrid.jqGrid('getGridParam', 'width'); // get current width
myGrid.jqGrid('setGridWidth', width, true);
This will not change the width of the grid, but force the shrinking of the columns.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With