DHTMLXGrid

Get Value



I need to get value of a cell of the row selected width specifying the column name.

And i don’t know column index, just the row selected.



For example :

var value = grid.cells(rowId,“MY COLUMN NAME”).getValue();

instead of

var value = grid.cells(rowId,columnIndex).getValue();



It’s possible ?



thanks

You can’t use column names, but you can use column IDs ( which can be specified by setColumnIds or id attribute in configuration XML )

grid.cells(rowId,columnIndex).getValue()
grid.cells(rowId,grid.getColIndexById(“column id”)).getValue();

In theory you can locate the column index by its name through getColumnLabel method ( itterate through columns and compare their names to known one ), but it really not the best approach

Good! it’s work correctly now.

Thanks a lot.