Forum



Hy,
I have this situation:
I have a grid. I json the postdata of the grid and save it into a cookie.
The postData looks like this:
{"_search":false, "nd": 1277448638394, "rows":10, "page":3, "sidx":"name", "sord":"asc"}
What i want to do is:
When I reload the page, i check if the cookie exists, and if exists I want to set the postData
to the value of the cookie and reload the grid.
I do it like this:
if cookie is set:
gridState = $.cookie('gridState'); //i retreive the value from the cookie. if i echo this is the value above
$("#gridId").setGridParam({postData : gridState}).trigger('reloadGrid'); // i change postData of the grid and reload it.
This is not working. The grid is not reloading with the new postData.
Am i doing something wrong?
Do I have to use other method?
Any help would be appreciated.
Thanks,
AdytmRO
Update:
I managed to load the grid with the data from the cookie like this:
gridState = $.cookie('gridState');
search = $.evalJSON(gridState)._search;
nd = $.evalJSON(gridState).nd;
rows = $.evalJSON(gridState).rows;
page = $.evalJSON(gridState).page;
sidx = $.evalJSON(gridState).sidx;
sord = $.evalJSON(gridState).sord;
urlBuild = "_search="+search+"&nd="+nd+"&rows="+rows+"&page="+page+"&sidx="+sidx+"&sord="+sord;
$("#listSurveys").setGridParam({postData : urlBuild}).trigger('reloadGrid');
But now the problem is that i cannot do anything on the grid.
If i press to go to the next page ... the grid is not changing the postData.
It always loads the postData that i have set.
How can I make the postData change again ?
Thanks,
AdytmRO
Most Users Ever Online: 715
Currently Online:
66 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