Welcome Guest Search | Active Topics | Sign In | Register

Item.key property in grid Options
Sanjay
Posted: Friday, March 13, 2009 12:04:11 AM
Rank: Member
Groups: Member

Joined: 8/26/2007
Posts: 12
Hi
while working with the button Column in the Grid control, I need to capture the primary key which is key property of GridItem (GridItem.key). I modified the java script code in the demo to read as follows

function OnItemCommand(grid,itemIndex, colIndex, commandName )
{
var item = grid.getItem(itemIndex);
var cell = item.getCell(2);
var itkey = item.key;
window.alert("Topic:" + cell.getValue() + " Item key is: " + itkey );

}

the value returns is 'Undefined'. I know same grid does have key value defined because i can run update method successfully by getting. item.key property in visual basic code
Thanks in advance

Sanjay
eo_support
Posted: Friday, March 13, 2009 8:17:14 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You will need to use item.getKey() instead of item.Key. The syntax for the client side interface is slightly different than that of the server side.

Thanks!
Sanjay
Posted: Friday, March 13, 2009 10:29:55 AM
Rank: Member
Groups: Member

Joined: 8/26/2007
Posts: 12
tried
item.GetKey()
with same results. see working page at www.sangwanmd.com/medrec you can see the key when you update the page as a label next to update button
eo_support
Posted: Friday, March 13, 2009 10:33:42 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Sanjay
Posted: Friday, March 13, 2009 11:03:18 AM
Rank: Member
Groups: Member

Joined: 8/26/2007
Posts: 12
It works..
Thanks for your excellent and timely support. your product works like charm
I appreciate your help





You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.