Check documentation for the latest version of dhtmlxSuite Using Get-Methods DHTMLX Docs

Using Get-Methods

Id/Index Manipulations

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

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

The parameters are as follows:

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

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

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

Getting Item's Image

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

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

Getting Item's Text

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

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

Getting Item's Label

The method getLabel() gets text representation of a cell:

treegrid.cells().getLabel();

Getting Row's Level

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

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

Getting Row's State

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

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

Getting Sub-Items

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

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