Rank: Member Groups: Member
Joined: 4/6/2008 Posts: 11
|
I have a grid with EmployeeId al Cell(0) and I need to pass this value to a session variable. Here's the script I'm trying to use but is not working.
<script type="text/javascript"> function OnItemSelected(grid) { var item = grid.getSelectedItem(); var eindex = item.getIndex(); var div = document.getElementById("divInfo"); (for testing pourposes) div.innerHTML = eindex;(for testing pourposes)
var ecell = grid.getSelectedCell(); var eval = ecell.getValue(); var div1 = document.getElementById("div1");(for testing pourposes) div1.innerHTML = eval;(for testing pourposes)
} </script>
I selected on the grid parameters SelectedCellIndex="1" and RunningMode=Client
Please advise.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi,
I don't think you can use getSelectedItem() and getSelectedCell() at the same time. When the Grid's FullRowMode is set to true, getSelectedItem(), when the Grid's FullRowMode is set to false, getSelectedCell() works.
Since you appear to be handling ClientSideOnItemSelected event, I would guess that your Grid's FullRowMode is set to true, in that case getSelectedCell() won't work for you.
Because you already know Cell(0) contains EmployeeId, you can use:
var item = grid.getSelectedItem(); var ecell = grid.getCell(0);
Hope that help.
Thanks
|