var selectedNode = $("#evts").jstree("get_selected");
Hi everyone.. I am using the above code to get the selected node from the tree. How to get all the children nodes for the selectedNode...I am using jstree 3.3...
Thanks in advance!
var currentNode = $("#evts").jstree("get_selected");
var childrens = $("#evts").jstree("get_children_dom",currentNode);
for(var i=0;i<childrens.length;i++)
{
alert(childrens[i].innerText);
}
the above code works as expected...
var selectedNode = $("#evts").jstree("get_selected");
var node_info=$('#evts').jstree("get_node",selectedNode[0]);
// this node_info contains **children_d** an array of all child nodes' id .
// **parents** an array of parent nodes
alert(node_info.children_d.join(','));
alert(node_info.parents.join(','));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With