score:2

Accepted answer

I want to warn you with reducing of the number of Ajax calls. If you are newbie in jqGrid it's important to understand some common thing in the usage of jqGrid:

  • jqGrid need be initialized once during call of grid.jqGrid({...});.
  • the url will be used multiple times by jqGrid.

The grid has some common user interface elements in pager (see the answer)

enter image description here

enter image description here

which can be used by user to interact with jqGrid. So if the user click on the "Next Page" button, Change the number of displayed rows or change the sorting column (or the direction of sorting) new request to the server, to url will be send. It is very practical to use other elements of user interface like searching tool:

enter image description here

which also produce new request to url with modified parameters. After receiving the server response only the grid body will be replaced. The other parts of the grid will stay unchanged. You can use GridUnload method to recreate the whole grid (see here examples)

So if you would transfer column definition every time together with the data of the grid you will send unneeded data, which can reduce the performance instead of improving which you want.


Related Query

More Query from same tag