I found a way to do this. In my case, I use xml as the data source for the tree. I bind the open_node event with jstree as follows. Keep in mind that although I use xml, the internal structure is the html data.
var jsTreeConfig = {};
$("#demo1").jstree( jsTreeConfig )
.bind('open_node.jstree', function( e, data ) {
var parentObj = data.rslt.obj;
var jstreeInstance = data.inst;
$(data.rslt.obj).find("li").each( function( idx, listItem ) {
var child = $(listItem);
});
});
source
share