There is a simple way to say that jqGrid does not load the data itself. You should use datatype: 'local' as the jqGrid parameter. This parameter says that you plan to fill the grid data yourself with functions such as addRowData or addJSONData (see the example in the jqGrid tableToGrid "options" parameter ), you can also fill the data in the grid inside the loadComplete , since jqGrid calls this function also in case datatype: 'local' .
Do not forget that the data that you specify as the addJSONData parameter will be read (parsed) using jsonReader and jsonmap . This gives you a good way to not manipulate the data received from the server so much. Instead, it is enough to correctly display data in jsonmap for jqGrid. A relatively complex example of data mapping can be found in Mapping JSON Data in a JQGrid .
If you are thinking about data transfer optimization, see the "Data Mapping" \ "Data optimization" section on the http://trirand.com/blog/jqgrid/jqgrid.html demo page. The idea is to replace the data structure with the presented table rows to an array of strings. Then no column names (filed structure names) will be sent from the server to the client, which compresses the data transfer. With this optimization, you can probably save a lot more time than in another way. Remember to enable data compression on the web server. It can also significantly reduce the size of data transfer.
In the end, I can recommend looking at my discussion question. Should I replace using addJSONData jqGrid with using setGridParam () and trigger ('reloadGrid')? , where I compare the use of the addJSONData () function using a trigger ('reloadGrid'). The reason is that if you want to update more, since one table of a trigger immediately ("reloadGrid") will be a little slower, as if you made only one ajax call, but the structure of your program will be much simpler using a trigger ('reloadGrid') . If you compare the total time in both cases, it may happen that data transfer is not the bottleneck that you have. Thus, it may be that the total page load time in both cases remains virtually unchanged. The best way would be to save time in both cases and decide how much you are willing to pay for a simple program design.
source share