//当浏览器调整大小时,调整jqGrid的大小
$(window).bind('resize', function () {
$("#gridList").setGridWidth($('.col-md-12').width());
}).trigger('resize');
$gridList.dataGrid({
url: "Handler/AdminHandler.ashx?ActionCode=GetArticleManageList",
height: $(window).height() - 500,
**autowidth: true,//如果shrinkToFit为true且设置了width值,则每列宽度会根据width成比例缩放;
shrinkToFit: true, //如果设为true,则Grid的宽度会根据父容器的宽度自动重算。**
rowNum: 30,
rowList: [30, 50, 100],
multiselect: true,
colModel: [ ],
pager: "#gridPager",
sortname: 'CreateTime asc',
viewrecords: true,
//讓jqGrid寬度和容器一樣
});
jqgrid调整宽度自适应
最新推荐文章于 2023-06-26 10:49:42 发布