Hi I am using jQGrid free version 4.1.2 and I am facing problem on loading tree grid. I am storing data in an array object and loading that in tree grid. When I am loading a small amount of data it is working fine but when the data is more of quantity it is taking to much time in rendering (setting the data in columns). The length of my array object is around 1700.
I am using below prperties to load the grid
grid.jqGrid({
datatype: "jsonstring",
datastr: mydata, //array object
colNames: scopes.gridheadercolumns, //passed externally
colModel: scopes.gridcolumns,
height: height, //passed externally
gridview: true,
loadonce: false,
viewrecords: viewrecordslist,
rowList: rowlists,
rowNum: rowNum,
multiSort: true,
ignoreCase: true,
grouping: gpenable,
sortorder: sortorder, //passed externally
autowidth: true,
sortable: false,
pager: "#" + pagerid, //passed externally
treeGrid: true,
treeGridModel: 'adjacency',
treedatatype: "local",
ExpandColumn: 'name',
sortname: 'name',
jsonReader: {
repeatitems: false,
root: function (obj) { return obj; },
page: function () { return 1; },
total: function () { return 1; },
records: function (obj) { return obj.length; },
expanded_field: "true"
},
loadComplete: function () {
var ts = this;
if (ts.p.reccount === 0) {
$(this).hide();
emptyMsgDiv.show();
} else {
$(this).show();
emptyMsgDiv.hide();
}
}
});
I have changed some of above properties like this
loadonce: true,
gridview: false,
treedatatype :"jsonstring"
Here which property can I remove from the function to make it load faster or what else can I do to improve the performance is I need.
Also, this problem occur specifically in IE 11. Not in other browser.
Any help would be appreciated. Thanks
Edit : I forgot to include one point that grid also become considerably slow when we load it muliple times. How can we ensure that performance not degrade with multiple request.
Code for tdynamicLink Formatter -
Here the foramtoptions url and cellattr are not used.
Only I am applying a class to make it look as a link (I am just making text underline and cursor to pointer in that class) and calling function getPopup to open modal window
if (formatter == "editLink") {
var subpopup = grid_row_data[j]._attr.popupid._value;
var xmlname = grid_row_data[j]._attr.popxml._value;
formatter= 'dynamicLink';
formoption= {
url: function (cellValue, rowId, rowData) {
return '/' + rowId + '?' + $.param({
tax: rowData.col_nigo,
invdate: rowData.col_igo_nigo,
closed: rowData.col_phireq
});
},
cellValue: function (cellValue, rowId, rowData) {
return '<span class="pointer">' + cellValue + '</span>';
},
onClick: function (rowId, iRow, iCol, cellValue, e) {
$("#"+subpopup).css("display", "block");
$("#" + popupid).css("opacity", "0.99");
$scope.getPopup(rowId, iRow, iCol,gridid ,xmlname,rowId);
}
};
cellattr = function (rowId, cellValue, rawObject) {
var attribute = ' title="' + rawObject.name;
if (rawObject.closed) {
attribute += ' (closed)';
}
return attribute + '"';
};
}