我在一个页面中使用两个jqgrids.我使用的第二个网格,loadonce: true因为我需要在第二个网格中进行列排序.我需要在服务器回发后重新加载两个网格.(需要在第二个网格中显示更新的值).第一个网格重新加载很好,因为它不会使用该loadonce属性.我的问题是我们可以一起使用loadonce属性reloadGrid吗?(通过loadonce动态设置属性到网格)或者在这种情况下我是否需要进行服务器端排序?请指教.提前致谢.
我们在网格上使用loadonce设置为true 的jqGrid导航器重新加载按钮.
重新加载按钮当前不会返回到服务器以获取数据 - 我们如何才能将重新加载到服务器以获取最新数据?
我相信我们可以利用beforeRefresh回调设置网格data来json代替local,但我不清楚如何,即使配置beforeRefresh方法-我真的不明白的文档.
数据很好地加载到网格中,但不会排序.
当我在表格标题中单击时,会出现排序箭头,但数据未被排序.
谢谢.
$("#CompTable").jqGrid({
url:'BomExplosionInJsonObj.asp'
, datatype: 'json'
, mtype: 'GET'
, height: 400
, colNames:['Part','Description','Src','Std Usage','Usage Inc Scrap','Rate Scrap','UOM','Item','Unit Cost','Stock']
, colModel:[ {name:'COMP1_PART',index:'Part', width:120}
, {name:'WSCOMPDESC',index:'Desc', width:300}
, {name:'WSCOMPSRC',index:'Src', width:10}
, {name:'COMPUSAGE',index:'Usage', width:80, align:"right",sorttype:"float"}
, {name:'WSGROSSQTY',index:'TotUsage', width:80, align:"right",sorttype:"float"}
, {name:'COMPRATE_SCRAP',index:'Rate Scrap', width:80, align:"right",sorttype:"float"}
, {name:'COMPBASIC_UNIT',index:'UOM', width:20}
, {name:'COMP1_ITEM',index:'Item', width:20}
, {name:'WSCOMPUNITCOST',index:'UnitCost', width:80, align:"right",sorttype:"float"}
, {name:'WSCOMPQTYSTOCK',index:'Stock', width:80, align:"right",sorttype:"float"}
]
, jsonReader: {
root:"rows"
, page: "page"
, total: "total"
, records: "records"
, repeatitems: false
, id: "0"
}
, …Run Code Online (Sandbox Code Playgroud) 我正试图让JqGrid在完成数据加载后立即进行客户端过滤(和排序).我可以正确设置搜索字段,但调用TriggerToolbar()似乎没有任何效果.
$("#list").GridUnload();
var mygrid = $("#list").jqGrid({
url: '@Url.Action("GetSearchCriteriaWithNoComponents", "SearchCriteria")',
postData: { BookingSiteId: function () { return $("#BookingSiteId option:selected").val(); }, MethodId: function () { return $("#MethodId option:selected").val(); } },
datatype: 'json',
mtype: 'Post',
colNames: ['Id', 'PID', 'Ori', 'Dest', 'Conn', 'Pos', 'Method', 'Billing', 'Filter', 'Pattern', 'Class', 'Wildcard', 'Components', 'Comment'],
colModel: [
{ name: 'Id', index: 'Id', width: 30, hidden: true },
{ name: 'PID', index: 'PID', width: 35 },
{ name: 'Ori', index: 'Ori', width: 35 },
{ name: 'Dest', index: 'Dest', …Run Code Online (Sandbox Code Playgroud)