📜  设置 jqgrid 的宽度 - 无论代码示例

📅  最后修改于: 2022-03-11 14:56:18.789000             🧑  作者: Mango

代码示例2
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); 
 });