Saali

Forum Replies Created

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • in reply to: Load Grid only on Demand #102153
    Saali
    Participant

    @OlegK said:
    Hello!

    One of the easiest way to control when the grid contain will be loaded is to switch the datatype of the jqGrid. You can start with the datatype:’local’, then jqGrid will be not loaded and some parameters like url or postData will not be used. Inside of click event handler  for your “Search” button you can change the datatype 

    $("#list").setGridParam({datatype:'json'}).trigger('reloadGrid',[{page:1}]);
    I recommend you to invest some time to understand how the parameters of the ajax request will be built which will be send to the server. Read for example this and this my old answers on the stackoverflow.com.

    Look at here and here for some additional informations. In the another answer I showed how one can use the standard parameters from the postData used by jqGrid for the Advanced Searching.

    Best regards
    Oleg 

    Hey OlegK,

    Similar to this query, I want the jqGrid to be empty when the page loads and I want to load data only when any data is searched (some of the columns in the grid are searchable). Any ideas? I’m asking because I dont know how to use  $("#list").setGridParam({datatype:'json'}).trigger('reloadGrid',[{page:1}]); explicitly for a search function of the jqgrid.

Viewing 1 replies (of 1 total)

Stay connected with us in your favorite flavor!