Welcome Guest Search | Active Topics | Sign In | Register

Grid Selected row cell value Options
nomo
Posted: Saturday, May 17, 2008 2:14:19 PM
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.
eo_support
Posted: Saturday, May 17, 2008 4:29:27 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,091
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


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.