I basically want to leave the grid blank on page load. Then based on a selection from drop down. I want to load the grid. How can I do that.
Thanks!
I basically want to leave the grid blank on page load. Then based on a selection from drop down. I want to load the grid. How can I do that.
Thanks!
You should set datatype: 'local'
at the beginning. So the grid will be empty without any contain. Then you should set 'change' handler on the dropdown element. Inside of the event handler you should change the datatype
to 'json' (or 'xml' depend on your requirements) with respect of $("#list").jqGrid('getGridParam', {datatype: 'local'})
and call trigger("reloadGrid",[{page:1}])
. Yo can use postData
with functions as the properties (see here) or just set url
parameter together with the datatype
inside of the 'change' event handler.