Skip to main content

how to disable data retrieval on jqgrid load



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.




Comments

  1. You should just use datatype: 'local' at the beginning. If you want to load the data from the server you should change datatype to 'json' with respect of setGridParam method and trigger reloadGrid.

    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 set datatype to 'json' for the detailed grid and reload it. In the postData of the detailed grid will be used the id of selected row from the master grid.

    ReplyDelete

Post a Comment

Popular posts from this blog

Slow Android emulator

I have a 2.67 GHz Celeron processor, 1.21 GB of RAM on a x86 Windows XP Professional machine. My understanding is that the Android emulator should start fairly quickly on such a machine, but for me it does not. I have followed all instructions in setting up the IDE, SDKs, JDKs and such and have had some success in staring the emulator quickly but is very particulary. How can I, if possible, fix this problem?