How can you create a grid but not load any data?
If I omit the url
option then the loadError
callback is triggered.
Currently we set url:NoData.json
where NoData.json is a static file with no rows in it.
Issue is in our loadComplete
callback we'd like to dipslay a message if the grid contains no data - except we don't want to display this message on the initial load. Currently we handles this as follows:
//jqGrid load complete handler
function loadComp(grid) {
if (grid.getGridParam("url") != "NoData.json" && grid.getGridParam("records") == 0) {
setStatus("Your search did not return any results");
}
}
This just seems a little hacky.. would like to just have the grid not load any data initially.
Any ideas?
datatype:local
and nourl
, myloadComplete
callback is still called. I was hoping for an approach that would not trigger the callback - or at least a cleaner way in the callback to determine this is the initial time the grid is loaded. – Whaleboat