DHTMLX Docs & Samples Explorer

Using Get-Methods

Id/Index Manipulations

There is a method that allows the user to get id of the child item at specified position by its index:

        var childId = treegrid.getChildItemIdByIndex(rowId,ind);

The parameters are as follows:

  • rowId - id of row;
  • ind - child node index.

Another method allows the user to get id of the parent row:

        treegrid.getParentId(rowId); // id of the row

Getting Item Image

The following method should be used to get the image of a tree column:

        treegrid.getItemImage(rowId); // id of the row

Getting Item Text

The caption of a tree column can be got like this:

        treegrid.getItemText(rowId); //  id of the row

Getting Item Label

Method getLabel() gets text representation of a cell:

        treegrid.getLabel();

Getting Row Level

The level of a TreeGrid row should be got in the following way:

        treegrid.getLevel(rowId); //  id of the row

Getting Row State

The following method returns open/close state of a row:

        treegrid.getOpenState(rowId); //  id of the row

Getting Sub-Items

The user can get the list of child row ids separated by a comma:

        treegrid.getSubItems(rowId); //  id of the row