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
ajax call question
31/12/2008
19:11
Avatar
Pete
Member
Members
Forum Posts: 100
Member Since:
01/09/2008
sp_UserOfflineSmall Offline

I have a grid that accesses json formatted data via an ajax call to a servlet routine. The first issue I had is that I have several values on the page that, when changed, should result in the grid being updated with the changed data.  When I called the function I wrote to reload the data, the servlet routine wasn't ever invoked, even though I could see the js function being called in debug.  I discovered the solution was to use the .trigger(”reloadGrid”) method and now the servlet was being invoked again.  All was well.

But the data returned from the servlet was the same data, so I checked the URL that was being passed in the grid.  In debug, the ajax url in the grid appears to be changed (I can see all the new values) but when it is passed to the servlet, the url appears to be unchanged (at least the parameters aren't changed although they ARE changed in the url that is invoked)

So the question is: Does jqGrid 'cache' the ajax call?  If so, can this behavior be changed?  If NOT, where should I look to see where the url is perhaps being cached.

Thanks

Follow up:

Further debugging of the grid.base.js shows that the at line 93 the value of the url found in p.url IS correct but when the json string is executed in line 831, the value of p.url and ts.p.url has reverted BACK to it's original value. So, somewhere in the code the correct value is being replaced by a cached value.  I don't know enough about jQuery to walk through all the code but something isn't quite right here.

Suggestions?

05/01/2009
02:49
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

jqGrid  does not cache the posted data. On every call we do:

nd: (new Date().getTime())

which prevents the cahing.

Also maybe you should do setGridParam({postData:{some:value}}) to set the new parameters. If you use trigger("reloadGrid") the data is reloaded with the currently setted parameters.

Usualy I do $("#mygrid").setGridParam({page:3}).trigger("reloadGrid")

to have efect this.

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.

06/01/2009
21:09
Avatar
Pete
Member
Members
Forum Posts: 100
Member Since:
01/09/2008
sp_UserOfflineSmall Offline

Thanks Tony.  That did it!  The setGridParam was what I needed.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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