Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Load Grid only on Demand
21/10/2010
00:00
Avatar
nmganesh
Member
Members
Forum Posts: 3
Member Since:
20/10/2010
sp_UserOfflineSmall Offline

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?

21/10/2010
17:01
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

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 

19/08/2014
09:48
Avatar
Saali
New Member
Members
Forum Posts: 2
Member Since:
19/08/2014
sp_UserOfflineSmall Offline

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.

20/08/2014
13:06
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
35 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information