dhtmlxGrid - how to get the grid object using row Id

Hi,



How can I get a reference to the grid object whose rowId is known to me.



This is the scenario where I have multiple subgrids for a given grid. I select a row in one of the subgrids and I want to know which subgrid it belongs to.



I am looking for something like getParentGrid(rowId).



Please suggest.



Thanks,

Gaurav Arora

Unfortunately there is no such method

Are you calling this code from some event of grid ? Each grid’s event has reference to related grid object, you can use “this” which points to the grid object inside any custom event attached to the grid. ( if same event attached to multiple grids, “this” will point to the grid which is actually fires event )

In common case, you can check is grid has row with such id by using


if (grid.getRowById(id)) alert(“such row exists”);