2012-08-08 64 views

回答

19

如果你想在網格重新大小動態,掛鉤到窗口重新大小功能,您可以使用setGridWidth財產

$('#gridId').jqGrid('setGridWidth', '800'); 

,但記得要設置初始寬度

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); 
}); 
+0

感謝張貼,感謝 – user603007 2012-08-08 07:24:12

+0

感謝您的工作 – 2012-09-14 22:42:19