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
jqgrid 4.0 replacement for setPostData incorrect
23/05/2011
14:01
Avatar
rekna
Member
Members
Forum Posts: 9
Member Since:
21/07/2009
sp_UserOfflineSmall Offline

/jqgridwiki/doku.php?id=wiki:upgrade_from_3.8_to_4.0.0

shows the replacement for setPostData and appendPostData, however, both replacement are exactly the same function.

jQuery(”#grid_id”).jqGrid('setGridParam',{postData:newdata})

This will always execute the equivalent of the old appendPostData, so it is not possible to do an setPostData

23/05/2011
20:09
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

This is correct indeed. Try:

jQuery("#grid_id").jqGrid('setGridParam',{postData:{my_existing_key_in_postData:newvalue}});

Regards

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.

23/05/2011
20:51
Avatar
rekna
Member
Members
Forum Posts: 9
Member Since:
21/07/2009
sp_UserOfflineSmall Offline

Maybe I'm missing something but:
$("#grid").jqGrid('setGridParam',{postData:{id:1,text:'something'}}) 
result of postdata is:

id: 1
text: "something"

$("#grid").jqGrid('setGridParam',{postData:{id:1,text2:'something'}})
 result of postdata is:

id:1
text:"something"
text2:"something"
while it should be:
id:1
text2:something
(this was the old behaviour of setPostData )

There should be a way to replace postData completely with new values, without preserving the old ones.

23/05/2011
21:02
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

To mimic exactley the old behaviour do:

$("#grid").jqGrid("setGridParam",{postData:{}});

$("#grid").jqGrid("setGridParam",{postData:{ .. other values here..} });

Will update the docs

Regards

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.

23/05/2011
21:22
Avatar
rekna
Member
Members
Forum Posts: 9
Member Since:
21/07/2009
sp_UserOfflineSmall Offline

I guess I'm not so happy with this breaking change... it means changing quite some code... may I please urge you to try to keep the interface a stable as possible. Is this kind of change really necessary, I don't understand the benefit of the change... 

23/05/2011
21:27
Avatar
rekna
Member
Members
Forum Posts: 9
Member Since:
21/07/2009
sp_UserOfflineSmall Offline

1. Even so, the proposed solution does not work, even after $("#grid").jqGrid("setGridParam",{postData:{}});
postData still contains all previous values 

2. are there maybe other cases where this behaviour has changed? maybe userdata as well ? other?

23/05/2011
22:50
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Opps,

try to replace

$("#grid").jqGrid("setGridParam",{postData:{}});

with

$("#grid").jqGrid("setGridParam",{postData: null });

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.

24/05/2011
11:30
Avatar
rekna
Member
Members
Forum Posts: 9
Member Since:
21/07/2009
sp_UserOfflineSmall Offline

this works... but please, please, please keep jqGrid API changes to an absolute minimum... this has kept me busy for days (it was already hard to find what was wrong, let alone to find a way to fix it, and to run through all code to add an extra line)

what about the other cases? how about userdata? 

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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