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
How do I access jqGrid data via jQuery?
04/12/2014
23:18
Avatar
MarkInChicago
New Member
Members
Forum Posts: 1
Member Since:
04/12/2014
sp_UserOfflineSmall Offline

I just started working with jqGrid today and got a working example where I can add, delete, and update data in the grid. My goal is to NOT have jqGrid post changes to the server. Instead, I need to let the user continue to edit and when they are done, I want to comb through the edits and post them to the server myself.

 

I've followed the examples and the array used to populate jqGrid appears unchanged but I see the changes do appear in the on-screen grid. So I'm stumped. I really need to understand where jqGrid stores its data/changes in its object model so I can extract the data.

Any ideas?

05/12/2014
14:35
Avatar
Nahro
Member
Members
Forum Posts: 13
Member Since:
02/10/2014
sp_UserOfflineSmall Offline

Heyo,

I just assume that you use datatype:local for that? Its hard to tell without your code :)

Have you set the editUrl correctly? - Even if jqGrid does not send anything to a server in local-mode it still needs to know what to do for editing.

editurl: "clientArray" -> tells jqGrid to write changes into the local array you give it.

onSelectRow: function(id){
  if(id!=lastsel){
     jQuery('#list').jqGrid('saveRow',lastsel);
     //Set Null, select new Row
     lastsel = null;
            
     jQuery('#list').jqGrid('editRow',id,{keys: true, aftersavefunc : function(id){

          //Do Array Manipulation here

          myArray[id] = ........;

}});          

...

(I hope its somewhat readable)

There are plenty of examples to be found in the wiki, or on the demo page if you look through it (which I reccomend)

 
 
Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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