I found the solution myself, using the get_selected api argument to filter leaves from folders -
var nodes = $("#js-tree").jstree(true).get_selected("full", true); $.each(nodes,function(i, node){ if(node.children.length >0){ console.log("not leaf"); } else{ console.log("leaf"); } });
If you have a better solution, let me know.
source share