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
Saving and loading grid filters
16/02/2011
12:34
Avatar
knutmarius
Member
Members
Forum Posts: 5
Member Since:
12/11/2010
sp_UserOfflineSmall Offline

I need to solve the following requirement:

The users of my jqgrid would like to be able to save the current state of the jqgrid filter so that it can be reloaded later. I have looked around on the web and found people with similar requirements. The first thing I tried was to use this to fetch the filter state:

var filter = cloneObject($("#MyGrid").getGridParam("postData"));

, and this to reload it:

$("#MyGrid").setGridParam(null);
$("#MyGrid").setGridParam(filter); 
$("#MyGrid").trigger("reloadGrid");            

This partly worked: If I set a filter value in the filter toolbar and saved it, it would be active when I reload it, but here is what's not working: 

1: It does not seem to load the advanced filters (filter dialog box). Only toolbar filter is loaded

2: Row ordering is not loaded

3: It does not populate the toolbar textboxes with the values. So if I load a filter with "ID=32", I would like the text box for the ID column in the filter toolbar to say "32" so you know what filter is currently active.

So my question is: Am I on the right track with using get/setGridParam for this functionallity? When I  look at the filter object that is persisted, it seems to contain all the info I want to save (also information about the advanced filter dialog and row ordering), but it is just not properly loaded.

About number problem number 3: Is there any neat way for doing this automatically, or do I have to parse the filter object and "manually" insert the filter values into the text boxes and dropdowns? I am imagining this would be more difficult to do for the advanced filter dialog, where I actually need to create new "filter rows", and not just set a value in a text box

Will be thankful for all hints and help! I am not very skilled in jqgrid yet, but I am learning Smile

18/04/2011
11:25
Avatar
donato.gr
Italy
Member
Members
Forum Posts: 4
Member Since:
18/04/2011
sp_UserOfflineSmall Offline

Hi,

I have the problem of reloading filters too; have you found a solution?

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
68 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