Here's a sample grid and subgrid I've tested this with. Unfortunately I can't provide you with an online link. Below are my comments and a potential fix. I hope this helps.
$(document).ready(function () {
var lastsel2;
$(“#list”).jqGrid({
url: '/GridData/',
datatype: 'json',
headertitles: true,
mtype: 'GET',
postData: {},
colNames: ['ID', 'Name', 'Last Start Time', 'Last Loop Time', 'Last Stop Time', 'Last Fail Time'],
colModel: [
{ name: 'ID', index: 'ID', key: true, width: 40, hidden: true, editable: false, sortable: true, sorttype: 'integer', search: true, stype: “text”, searchoptions: { sopt: ['cn', 'bw', 'eq', 'ne']} },
{ name: 'Name', index: 'Name', width: 250, hidden: false, editable: false, sortable: true, sorttype: 'text', search: true, stype: “text”, searchoptions: { sopt: ['cn', 'bw', 'eq', 'ne']} },
{ name: 'LastStartTime', index: 'LastStartTime', width: 150, hidden: false, editable: true, sortable: true, sorttype: 'date', datefmt: 'y-mm-dd h:i:s', search: true, stype: “text”, searchoptions: { sopt: ['cn', 'bw', 'eq', 'ne']} },
{ name: 'LastLoopTime', index: 'LastLoopTime', width: 150, hidden: false, editable: false, sortable: true, sorttype: 'date', datefmt: 'y-mm-dd h:i:s', search: true, stype: “text”, searchoptions: { sopt: ['cn', 'bw', 'eq', 'ne']} },
{ name: 'LastStopTime', index: 'LastStopTime', width: 150, hidden: false, editable: false, sortable: true, sorttype: 'date', datefmt: 'y-mm-dd h:i:s', search: true, stype: “text”, searchoptions: { sopt: ['cn', 'bw', 'eq', 'ne']} },
{ name: 'LastFailTime', index: 'LastFailTime', width: 150, hidden: false, editable: false, sortable: true, sorttype: 'date', datefmt: 'y-mm-dd h:i:s', search: true, stype: “text”, searchoptions: { sopt: ['cn', 'bw', 'eq', 'ne']} }
],
onSelectRow: function (id) {
if (id) {
if (id != lastsel2) {
$('#list').jqGrid('saveRow', lastsel2);
$('#list').jqGrid('restoreRow', lastsel2);
$('#list').jqGrid('editRow', id, false);
lastsel2 = id;
}
else {
$('#list').jqGrid('saveRow', lastsel2);
lastsel2 = -1;
}
}
},
height: “100%”,
ignoreCase: true,
imgpath: '../../Scripts/jQueryUI/css/cupertino/images/',
loadonce: true,
loadui: 'block',
multiselect: true,
refresh: true,
reloadAfterSubmit: false,
rowList: [-1, 10, 20, 50, 100],
rowNum: 20,
shrinkToFit: false,
sortable: false,
sortname: 'ID',
sortorder: “desc”,
subGrid: true,
subGridRowExpanded: function (subgrid_id, row_id) {
AddSubGrid(subgrid_id, row_id)
},
toppager: true,
viewrecords: true
});
function AddSubGrid(subgrid_id, row_id) {
var subgrid_table_id;
subgrid_table_id = subgrid_id + “_t”;
jQuery(“#” + subgrid_id).html(“
“);
jQuery(“#” + subgrid_table_id).jqGrid({
url: 'SubGridData' + '//' + row_id,
I have this exact same issue. The problem is only occurring with grids that have subgrids attached.
Have you made any progress?
I haven't done much investigation
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top