|
Rank: Member Groups: Member
Joined: 11/20/2008 Posts: 14
|
Hello,
I got an issue, I need to pass to other page the KeyFiel of the grid but im trying to do it by a javascript function. I got this function in my ClientSideOnItemCommand:
<script language="javascript" type="text/javascript">
function OnItemCommand(grid, itemIndex, colIndex, commandName) { var item = grid.getItem(itemIndex); var Edicion = 'Edicion'; var NombreCompleto = item.getCell(1); window.open('SegNvoEdicion.aspx?Tipo='+Edicion.valueOf() +'&Nm='+ NombreCompleto.getValue());
}
</script>
I cant take the keyfield by refering a cell in the grid because the keyfield is not a column in my grid I just call the column in the SELECT instruction of my SQLDataSource but is not shown on my grid. So i dont know if its posible to do this.
Please help, and thanks.
|
|
Rank: Member Groups: Member
Joined: 11/20/2008 Posts: 14
|
Hi,
I´d been trying with this:
<script language="javascript" type="text/javascript">
function OnItemCommand(grid, itemIndex, colIndex, commandName) { var item = grid.getItem(itemIndex); //var cell = item.getCell(1); var Edicion = 'Edicion'; var key= grid.getItem.getKey(); var NombreCompleto = item.getCell(1); //window.open('SegNvoEdicion.aspx?Tipo='+Edicion.valueOf() +'&IdPlanilla='+ key.getValue()); window.alert(Edicion.valueOf()+', '+key.getValue());
}
</script>
When do Click in my button column to display the alert with the values i got this message error: "Microsoft JScript runtime error: Object doesn't support this property or method" and the line "var key= grid.getItem.getKey();" appears marked. I can´t find any reference for this issue. Please help.
Thanks.
|
|
Rank: Member Groups: Member
Joined: 11/20/2008 Posts: 14
|
Eurekaaa!!!!
Now it´s ok, if somone else its looking for this issue, the problem was me jejeje. Finally i solved it by changing the code like this:
<script language="javascript" type="text/javascript">
function OnItemCommand(grid, itemIndex, colIndex, commandName) { var item = grid.getItem(itemIndex); var key= item.getKey(); window.alert(key.valueOf());
}
</script>
I hope this will be helpfull, Thanks :)
|
|