Resize jqGrid when browser is resized?

Justin Ethier picture Justin Ethier · May 17, 2009 · Viewed 104.2k times · Source

Is there any way to resize a jqGrid when the browser window is resized? I have tried the method described here but that technique does not work in IE7.

Answer

Stephen Fuhry picture Stephen Fuhry · Oct 27, 2009

Been using this in production for some time now without any complaints (May take some tweaking to look right on your site.. for instance, subtracting the width of a sidebar, etc)

$(window).bind('resize', function() {
    $("#jqgrid").setGridWidth($(window).width());
}).trigger('resize');