$('#jstree_demo_div2')
.on('loaded.jstree', function (e, data) {
$('#jstree_demo_div2').jstree("open_all");
console.log("CountNodes");
CountNodes(); //This method is used to count how many nodes have been checked after the tree data loading
})
.jstree({
'core': {
'data': {
"url": function (node) {
return "tree.ashx?a=" + Date.now();
},
"dataType": "json"
}
},
"checkbox": {
'visible': true,
'keep_selected_style': false,
},
"plugins": ["wholerow", "checkbox"]
});
'loaded.jstree' has been called only at the very first time (which is loading the page) .
Then if I manually call ajax to refrash : $('#jstree_demo_div2').jstree(true).refresh();
the data has been changed, but method CountNodes() has not been called. (Actually, none of them in 'loaded.jstree' have been called)
Isn't 'refresh()' a way of 'loading' event?