I have a grid (version 4.1.1) using a subGrid. I'm using loadonce: true and scroll: 1. When the grid first loads, I can open subGrids with no problem, until I scroll the main grid down to the point where it loads more data. After that, no subgrid will open or close. If I click on the plus icon, I see the "Loading...", but nothing happens. I can't even close the subGrids that were previously opened.
Here is my grid definition:
$("#grid_sites").jqGrid({
url:'getgridxmlsites.php',
postData: {detailid: function() {return $('#hdnDetailId').val(); }},
datatype: 'xml',
height: 260,
width: 832,
shrinkToFit: false,
caption:'',
colNames :['studydetailid', 'Site', 'Name', 'Status', 'Location'],
colModel :[
{name:'detailid', index:'detailid', width:0, hidden: true },
{name:'sitenumber', index:'sitenumber', width:60, align:'right'},
{name:'name', index:'name', width:230},
{name:'status', index:'status', width:110, align:'center'},
{name:'location', index:'location', width:74}
],
pager:'pager_sites',
scroll: 1,
viewrecords:true,
sortable:true,
sortname: 'sitenumber',
autowidth: true,
pgbuttons: false,
loadonce: true,
// gridview: true, // Cannot be used when using subGrid.
onSelectRow: function(id){ gridRowSelect(id) },
subGrid: true,
subGridUrl: 'getgridxmldatabysite.php',
subgridtype: 'xml',
subGridModel: [{
name: ['Owner', 'Phone', 'Status'],
width: [120, 100, 100],
align: ['left', 'left', 'left'],
params: ['detailid']
}],
subGridOptions: { reloadOnExpand : false }
});
I hope you can help.
Typical the
"Loading..."
means an error in the processing of the server response. I recommend you to usejquery.jqGrid.src.js
instead ofjquery.jqGrid.min.js
and to start your page in the debugger. For example you can use Developer Tools of Internet Explorer. Do do this you should press F12 to start Developer Tools, then choose "Script" and click on "Start debugging" button. Either the page will be stopped on error or you will be see some additional information in the "Colsole" on the right pane.I personally not use
scroll: 1
option because of complexity of the data processing and different known bugs or problems. It seems to me that you use incompatible combination of parameters. I would recommended you to remove eitherloadonce: true
orscroll: 1
parameter.