Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by C. Bernstein on Nov 17, 2009 06:18
open dhtmlx forum
Getting the xmlkids value

I am working on a drag and drop page between two tree grids. I want to implement the rule that only a leaf node (i.e. one without children, xmlkids value is not 1) can be dragged. Is there a function to call to get this information?

thanks.
Answer posted by dhxSupport on Nov 17, 2009 06:47
Answer posted on Nov 17, 2009 06:49
Thanks.  I was actually asking about whether there is a function which tells you whether a row is a leaf node or not, or what the value of the xmlkids for that row is?
Answer posted by dhxSupport on Nov 18, 2009 02:36
To find out if node has children you can use:
treeGrid.hasChildren(node_id);

You can get node's sub items with:
treeGrid.getSubItems(node_id);

You can get node's level with:
var level=treeGrid.getLevel(node_id);

Also you can get node's parent id:
var parId=treeGrid.getParentId(node_id);

Please find example here http://www.dhtmlx.com/docs/products/dhtmlxTreeGrid/samples/03_nodes_rows_manipulations/02_treeGrid_api2.html

Answer posted on Nov 18, 2009 07:44

When I attach an onBeforeDrag and call grid.hasChildren(id) it returns 0 if I have not expanded the node.  I want to be able to tell if it's a parent whether or not I expanded it.  How can I do this??

 

thanks