get cell row index

I’m writing a cell template and I’d like to access from it the row of the grid.
At the moment I’ve written the following code that gives me back the rowIndex of a cell and from that I’m able to retrieve the row.

return this.cell.parentNode.rowIndex - 1;

May you confirm me that this is correct? I mean, I’ve looked at the documentation and I couldn’t find any ad hoc method in your exposed API.

Best regards, Andrea Pirola

You can get row index by id with following code:

var rowIndex=mygrid.getRowIndex(“row_id”);

mmmmmmmm, sorry but it was not the answer I was looking for.
I mean, I was asking for a way for retrieving the row index of a cell from the cell object itself (I’m writing a new cell template), not a way for converting the row_index in a row_id (or viceversa).

Best regards, Andrea Pirola

You can get id of the row with following code:


where this - pointer to the cell object.

You can convert id to index with getRowIndex() method