DHTMLX Docs & Samples Explorer

Index
dhtmlxgrid
API Methods

### gridToTreeElement(treeObj,treeNodeId,gridRowId)

Required library edition:
Required library file: dhtmlxgrid_drag.js

Redefine this method in your code to define how grid row values should be used in tree (using input parameters you can change id of new tree node, set label, set userdata blocks etc.).

- treeObj - object of tree
- treeNodeId - id of node created in tree
- gridRowId - id of grid row

Value , which is returned from the method, will be used as text label of the item in a tree.

     grid.gridToTreeElement = function(tree,treeID,gridID){
                return this.cells(gridId,0).getValue();  // take data from the first column as a value for the tree
            }

See also: gridToGrid