Forum


06:27

30/11/2008

Hi,
Is it possible to save the search parameters in session or a cookie, so that next time the user comes back to the page the grid can be setup to display the previous results and also the search parameters are populated. We can keep track of the search parameters and use them to display the same data, but how can we populate them into the grid?
Thanks
Anurag
07:42

19/12/2008

This is what I do :
(seach parameters input id's always stats with "gs_")
Save search parameters ("memoriseFiltre" is a function that saves a cookie)
var initialLoad = true;
jQuery("#mygrid").jqGrid({...
loadComplete: function() {
// Save filters, but not when displaying the page for the first time
if (!initialLoad) {
$(document).find("[id^='gs_']").each( function() {
memoriseFiltre($(this).attr('id'), $(this).val());
});
initialLoad = false;
}});
Get back search parameters ("recupereFiltre" is a function that gets a cookie value)
// After creating the grid
var filterValue;
$(document).find("[id^='gs_']").each( function() {
filterValue= recupereFiltre($(this).attr('id'));
$(this).val(filterValue);
});
03:12

19/12/2008

In 3.5, there is a new functionnality : summary footer row that uses a second array (userdata) in the json result. Maybe you could use something like this to store your search parameters ?
I don't know if you can access to the json array in the client side script, but maybe Tony could tell us…
02:33

Moderators
30/10/2007

Hello,
You can use postData array for this purpose.
Store the the search parameters and then:
var stored_param = {}
stored_param = here your code to get these
...jqGrid({
...
postData: stored_param,
...
});
Do not forgaet maybe to add search:true in these parameters
Regards
Tony
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.
21:28

30/11/2008

Hi,
From my page I am passing back the search data parameters that were stored in the session in userdata as follows -
userdata { searchdata: [{field:firstname, op:bw, value:A}, {.....}] }
and can access the same in the gridComplete event.
How can I set these values back into the search form (multisearch:true), so that when the user presses the search button, the search parameters are already selected for him?
Thanks
Anurag
03:58

Moderators
30/10/2007

Hello,
Right now I understand what you mean. Sorry currently not possible.
Regards
Tony
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.
02:40

Moderators
30/10/2007

Hello,
Everything is possible
Regards
Tony
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.
05:08

Moderators
30/10/2007

Hello,
Actually you can look at jquery.searchFilter.js.
Regards
Tony
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.
00:17

30/11/2008

Hi,
The way we are implementing this is to save the search parameters in session when ever a search is conducted. Then when the user returns to this page, we use the session value to filter the data and also return the values as user data in the json string. The grid complete function is utilized to set these values as search critera.
Thanks
Anurag
Most Users Ever Online: 715
Currently Online:
64 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