我在单击按钮时重新加载 JQGrid,但是在每次单击时,它的宽度都会增加并放置水平滚动条。即使重新加载,如何将宽度固定为浏览器宽度的 100%。这是我的代码
jQuery("#enhDg").jqGrid({
url:"/ItLabourEffort/effort/grid/enhView",
datatype: "json",
colNames:['Customer/Capibility Name','Completed-FYTD','In Progress','In Queue','Customer'],
colModel:[
{name:'capabilityName',index:'capabilityName' ,width:'500',summaryType:'count', summaryTpl : 'Total Count: {0}', align: 'center'},
{name:'completedFYTD',index:'completedFYTD', align:'center', sorttype:'number',summaryType:'sum' ,width:'300'},
{name:'inProgress',index:'inProgress', align:'center',sorttype:'number',summaryType:'sum',width:'300'},
{name:'queue',index:'queue', align:'center',width:'250',summaryType:'sum'},
{name:'customerName',index:'customerName' ,width:'550',summaryType:'count'}
],
rowNum: 10,
rowList:[10,20,30],
height:$("#container").height(),
sortname: 'invdate',
viewrecords: true,
width: '100%',
sortorder: "desc",
caption:"Enhancement Forecast View",
grouping: true,
groupingView : {
groupField : ['customerName'],
groupColumnShow : [true],
groupText : ['<b>{0}</b>'],
groupCollapse : false,
loadonce:true,
groupOrder: ['asc'],
groupSummary : [true],
showSummaryOnHide: true,
groupDataSorted : true
},
footerrow: true,
userDataOnFooter: true,
});
jQuery("#enhDg").jqGrid('navGrid','#enhDg',{add:false,edit:false,del:false});
jQuery("#enhDg").jqGrid('hideCol','customerName');
$('#timeSelectorRadio input[type=radio]').change(function() {
jQuery("#enhDg").jqGrid().setGridParam(
{
datatype:'json',
url : "/ItLabourEffort/effort/grid/enhView2"
}
).trigger("reloadGrid");
jQuery("#enhDg").jqGrid('hideCol','customerName');
});