Hello,
Is there a method which resize grid width & height to fit its parent container?
I use jqGrid with “jquery layout” and want my grid to fit ui-layout-container which dynamically resizes (both width & height).
option:autowidth is not dynamic and also doesn’t work for height.
So I am now using my own function like the following. (I trigger this function whenever container resizes)
function resize_grid(grid) {
var container = grid.parents(‘.ui-layout-content:first’);
grid.jqGrid(‘setGridWidth’, container.width()-2); // -2 is border width?
var h = grid.parents(‘.ui-jqgrid:first’).height() – grid.parents(‘.ui-jqgrid-bdiv:first’).height();
grid.jqGrid(‘setGridHeight’, container.height() – h – 2);
}
Please advise me if there is better or easier solutions.
Thank you