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_Related Related Topics sp_TopicIcon
Reload last grid state
25/06/2010
10:08
Avatar
AdytmRO
Romania
Member
Members
Forum Posts: 24
Member Since:
16/09/2009
sp_UserOfflineSmall Offline

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

25/06/2010
12:23
Avatar
AdytmRO
Romania
Member
Members
Forum Posts: 24
Member Since:
16/09/2009
sp_UserOfflineSmall Offline

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      

25/06/2010
13:32
Avatar
AdytmRO
Romania
Member
Members
Forum Posts: 24
Member Since:
16/09/2009
sp_UserOfflineSmall Offline
Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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