Forum
00:00
19/10/2010
Hi, I am new to JqGrid and Jqurey as well. When I tried the examples, all of them load the grid when the page loads.
My requirement is I don't want the Grid to be loaded when the page is loaded.
I will have a Search button and the Grid needs to be loaded only when I click on that button.
But I need the Grid to be shown(with no data) obviously when the page loads.
Could anyone help me out on thsi please?
17:01
10/08/2009
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
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
09:48
19/08/2014
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 Â
explicitly for a search function of the jqgrid.
13:06
Moderators
30/10/2007
Hello,
Â
It depends which serch you use. See the events in the appropriate search module in the docs.
You will find a event before serching and event after serching which is maybe your solution - i.e befre search set the data type to json and after search set it again to local.
Â
Regards
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
24 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66