Welcome Guest Search | Active Topics | Sign In | Register

Grid, First column to a var. Options
Ellery Gomez
Posted: Wednesday, August 12, 2009 8:38:20 PM
Rank: Member
Groups: Member

Joined: 8/4/2009
Posts: 16
Hi, I am new to dotnet and java, I am working with the grid and I learned a bit thanks to the documentation that comes with the product. I have encountered the following problem, I used the code below for the selected object:

OnCellSelected function (grid)
(
var cell = grid.getSelectedCell ();
var cont = cell.getValue ();
)

This returned the selected cell which is correct, but what I need is that the program returns the value in the first column, no matter on which column is clicked.

For example

Col1, col2, col3
a, b, c
e, f, g
h, i, j,

If you selected "b" or "c" I want that the variable returns "a", if "j" is selected, I want that the variable be "h", and so on.

Can you help me with this?

Thanks in Advance, Best Regards
eo_support
Posted: Wednesday, August 12, 2009 8:42:47 PM
Rank: Administration
Groups: Administration

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

You would do something like this:

Code: JavaScript
//Get the selected cell
var cell = grid.getSelectedCell();

//Get the row that contains the selected cell
var row = cell.getItem();

//Get the first cell in the row
var firstCell = row.getCell(0);

//Get the value of the first cell
var value = firstCell.getValue();


Thanks!
Ellery Gomez
Posted: Wednesday, August 12, 2009 8:55:53 PM
Rank: Member
Groups: Member

Joined: 8/4/2009
Posts: 16
Thank you very much I really appreciate your fast response.

Best Regards


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.