I would like to change the width of a jqGrid. I tried to set the width in my griddefinition:
width: '800px'
Is there another way?
I would like to change the width of a jqGrid. I tried to set the width in my griddefinition:
width: '800px'
Is there another way?
You could use the setGridWidth
property
$('#gridId').jqGrid('setGridWidth', '800');
If you want the grid to re-size dynamically, hook into the window re-size function, but remember to set the initial width
var DataGrid = $('#gridId');
//sets the grid size initially
DataGrid.jqGrid('setGridWidth', parseInt($(window).width()) - 20);
//handles the grid resize on window resize
$(window).resize(function () {
DataGrid.jqGrid('setGridWidth', parseInt($(window).width()) - 20);
});
© 2022 - 2024 — McMap. All rights reserved.