Stop loading detail grid at page load
How can I stop DetailGrid from not loading at page load. Because I have button in master grid to load Detail Grid. Below is code for Detail Grid.
jQuery().ready(function () {
jQuery("#list10_d").jqGrid({
height: 100,
url: '/JQSandbox/MyFullSubGridData?id=0',
datatype: "json",
mtype: 'POST',
colNames: ['Index', 'Name', 'Department', 'Hire Date', 'Supervisor'],
colModel: [
{ name: 'employeeID', index: 'employeeID', width: 10 },
{ width: 30 },
{ name: 'employeeDepartment', index: 'employeeDepartment', width: 30 },
{ name: 'employeeHiredate', index: 'employeeHiredate', width: 40, sortable: false },
{ name: 'employeeSup', index: 'employeeSup', formatter: 'checkbox', align: 'center', width: 30, search: false }
],
loadtext: "",
loadui: "block",
width: 500,
rowNum: 5,
rowList: [5, 10, 20],
pager: '#pager10_d',
sortname: 'employeeID',
viewrecords: true,
sortorder: "asc",
multiselect: true,
capti开发者_如何学JAVAon: "Detail Grid: 1"
}).navGrid('#pager10_d', { add: false, edit: false, del: false });
});
You should set datatype: "local"
on the detail grid initially and change it to datatype: "json"
before calling of jQuery("#list10_d").trigger("reloadGrid")
:
jQuery("#list10_d").jqGrid('setGridParam',{datatype:"json"}).trigger("reloadGrid");
精彩评论