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
More than one Key column
30/10/2008
07:46
Avatar
shibaji
Member
Members
Forum Posts: 14
Member Since:
18/10/2008
sp_UserOfflineSmall Offline

If I set a key:true for a column then the post data name is hard coded id not the name of the column.

Moreover if I want to set more than one column as key column then How can I do that?This is required if the table has more than one primary key.

31/10/2008
03:02
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

If you identify the multikey server side you should not do anything.

If you want to work client side you maybe need to use getRowData(rowid)

to get the needed other key values.

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.

19/08/2009
03:30
Avatar
Buga
Guest
Guests

I have the same problem. I want to delete rows in a table but the key consits of 2 ids

Example table

Softwareid Serverid
1 4
1 3
1 16
3 6
3 3
3 8

I try to get the id with getGridParam('selrow');

Imagine I select row 3. getGridParam('selrow'); returns 1 in this case(I didnt defined a key column so the first one is the id). Than I need to get the second id of the server (16).

Here I use getRowData(1). The problem is quite simple. Now I get the values softwareid=1 and serverid=4 instead of 1,16.

How can I solve this problem? Is there some kind of internel id for a row which I could use?

19/08/2009
07:08
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Use the beforeSubmit submit event to set other values

http://www.trirand.com/jqgridw.....delgridrow

Best 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.

19/08/2009
07:27
Avatar
Buga
Guest
Guests

Hi thx for your reply.

I think I have to define my problem more clearly.

When I use the getGridParam method I get the id of this row(in my case the softwareid). The problem is that I have multiple rows with the same id(1-3 and 4-6). When I try to get other values of this row jquery cant know which row I mean and thatswhy I always get the first row with this id.

I hope you know get the problem I have.

Here is the code I am using atm:

 

 

 

 

onclickSubmit : function(eparams) {
//Funktion um 2 Parameter für die Löschmethode zu übergeben
var retarr = {};
var sr = jQuery("#Account_Server_Software_Zuweisung").getGridParam('selrow');
rowdata = jQuery(
"#Account_Server_Software_Zuweisung").getRowData(sr);
alert(
"Zeile:"+sr+"ServerID:"+rowdata.server_id+"SoftwareID"+rowdata.software_id)
retarr =
{server_id:rowdata.server_id,software_id:rowdata.software_id};
return retarr;}}//Options for Del Dialog

21/08/2009
02:31
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

You can manipulate this easy.

Server side set a uniquie id and pass this id as the id of the grid - can be a combination of the two keys (See Data manipulation in the documentation)

Then use your code.

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.

21/08/2009
04:02
Avatar
Buga
Guest
Guests

ok thx

I thought already about doing this way. just pass another id which is a combination of both.

I thought there might be a better way:)

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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