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
Pass Composite Key from jqGrid to server file
10/09/2008
03:10
Avatar
mexposito
Member
Members
Forum Posts: 4
Member Since:
14/07/2008
sp_UserOfflineSmall Offline

Hi all!

Is it possible to pass several attributes (i.e., 5) to jqgrid as a primary key to identify a row? I'm using java (struts+ibatis+jsp) technologies and need more than one field as row key to update the database.

Thanks!

10/09/2008
10:07
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

What you mean with this?

Do you use inline edit or formedit?

Please be a more detailed in question.

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.

10/09/2008
10:26
Avatar
mexposito
Member
Members
Forum Posts: 4
Member Since:
14/07/2008
sp_UserOfflineSmall Offline

I'm using inline editing. I don't have any code implemented yet, because first I need to know if this is possible. Let's suppose I have the example code

colModel:[ {name:'id',index:'id', width:55},{name:'invdate',index:'invdate', width:90, editable:true}, {name:'name',index:'name', width:100,editable:true}, {name:'amount',index:'amount', width:80, align:"right",editable:true}, {name:'tax',index:'tax', width:80, align:"right",editable:true}, {name:'total',index:'total', width:80,align:"right",editable:true}, {name:'note',index:'note', width:150, sortable:false,editable:true} ],

In this example, the field 'name' is editable, so it will be passed to the server (a struts action in my particular case) through the request.

If the field "id" is the PK of my table, how can I pass it to the server script without making it editable?

Now, let's suppose the PK of my table is formed by two attributes, let's say 'name' and 'tax'. How can I pass these two without making them editable? Even more, how can I pass them without showing them to the user in the table? (as they conform the primary key of the table, I don't want the user neither modify them nor even view them).

I hope this helps to clarify my question... thanks in advance

Regards

10/09/2008
10:33
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Please refer to docs. You can use extraparams for this purpose.

Before editing the rows you can get the hidden fields

with getRowData method.

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.

10/09/2008
17:20
Avatar
mexposito
Member
Members
Forum Posts: 4
Member Since:
14/07/2008
sp_UserOfflineSmall Offline

Ok, it's done :)) Thanks a lot, the truth is that I was looking at the examples and forgot about the docs themselves... after reading and a little bit of testing it's working now.The only thing I can't solve is that when I change a cell value and press enter, the value sent to the action servlet is the old one, not the one I've just entered. Perhaps I've not understood the doc in a correct manner...I've checked that, if I introduce a second new value in the cell, the first new value is sent to de servlet and then the field is updated to that value (the second). Could you help me with this?

Thank you very much!

10/09/2008
17:56
Avatar
mexposito
Member
Members
Forum Posts: 4
Member Since:
14/07/2008
sp_UserOfflineSmall Offline

Ok, I solved it. I was using the getRow method before the editRow method, and then passing the extraparams with all the row fields (including the old value of the field I was editing). I've manipulated the array so that only pass the extraparams I need, not everyone. Now the plugin works perfectly...

Thanks a lot and sorry for the inconvenience. Congratulations, it's the one of the best (if not the best) grid plugin I've seen.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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