Closed GoogleCodeExporter closed 9 years ago
jqGrid does not support an automatic resizing. I use following workaround:
<div id="content">
<sjg:grid id="mygrid" ... >
<!-- The Grid Columns -->
</sjg:grid />
</div>
<script type="text/javascript">
$(document).ready(function() {
jQuery(window).bind('resize', function() {
// Get width of parent container
var width = jQuery("#content").width();
width = width-35; // Fudge factor to prevent horizontal scrollbars
if (width > 0 &&
// Only resize if new width exceeds a minimal threshold
// Fixes IE issue with in-place resizing when mousing-over frame bars
Math.abs(width - jQuery("#mygrid").width()) > 5)
{
jQuery("#mygrid").jqGrid('setGridWidth', width-40, true);
}
}).trigger('resize');
});
</script>
Original comment by johgep
on 13 Jan 2013 at 10:02
Original issue reported on code.google.com by
pramod1...@gmail.com
on 26 Dec 2012 at 9:02Attachments: