DHTMLX Docs & Samples Explorer

gridToTreeElement(treeObj,treeNodeId,gridRowId)

Required library edition: This method requires Professional Edition of the DHTMLX library
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

Returns if true, then grid row will be moved to tree, else - copied

 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