jqgrid is used to show stock status from server. Data is retrieved in json format using controller in url parameter:
url: 'Grid/GetData'
Getting data (even 0 rows) takes some time. This causes noticeable delay on page load.
How to disable GetData controller call on initial jqgrid load?
On initial load empty grid should appear, without rows.
Data should retrieved if such command is issued by user:
- search criteria is entered
- enter is pressed in search toolbar
- refresh button in jqgrid toolbar is pressed.
You should just use
datatype: 'local'at the beginning. If you want to load the data from the server you should changedatatypeto ‘json’ with respect ofsetGridParammethod and triggerreloadGrid.In many scenarios like master/detailed grid I use the way. At the beginning the detailed grid has
datatype: 'local'. If a row will be selected at the master grid I setdatatypeto ‘json’ for the detailed grid and reload it. In thepostDataof the detailed grid will be used the id of selected row from the master grid.