Closed hmendezm closed 8 years ago
Hello Henry Something like this (from some example)?:
var i, j;
for (i = 0, j = data.selected.length; i < j; i++) {
console.log(data.instance.get_node(data.selected[i]).id);
}
Hi, you can look on the code of the sample page: https://github.com/ezraroi/ngJsTree/blob/gh-pages/treeCtrl.js
var selectedNode = vm.treeInstance.jstree(true).get_selected();
i don't know the node struct,how can i use it
the node struct json string is can't print out, api show the select node params node selected event, but how use it to get the node's id text ,parent node
Hi guys
First at all, thanks very much in put together this directive. I start using Today and really like it a lot. I have tried to get the node that is selected by the user in the reeview without any sucess. It is not clear for me how to use plugins in the directive. for example there is a plugins called changed that return the selected node but I do not know how to translate that following jstree code.
$(function () { $("#plugins") .on("changed.jstree", function (e, data) { console.log(data.changed.selected); // newly selected console.log(data.changed.deselected); // newly deselected }) .jstree({ "plugins" : [ "changed" ] }); });
So, the short question is how I can get teh selected node by the user so I can use it to show information related to the node.
Best Regards Henry