selectnodes - jsTree "select_node" returns false -
i using jstree in angularjs , using "select_node" in "ready". method returning false. on code debugged, observed tree.instance._model.data doesn't have node this.get_node(obj); returns false. (below code snippet)
select_node : function (obj, supress_event, prevent_open, e) { var dom, t1, t2, th; if($.isarray(obj)) { obj = obj.slice(); for(t1 = 0, t2 = obj.length; t1 < t2; t1++) { this.select_node(obj[t1], supress_event, prevent_open, e); } return true; } obj = this.get_node(obj); //here returns false if(!obj || obj.id === '#') { return false; } }
i not sure why tree.instance._model.data doesn't have data @ time because works when refresh browser.
any help? below code snippet.
me.ontreeready = function (eve, tree) { tree.instance.deselect_all(); tree.instance.refresh(true, true); var response = tree.instance.select_node(defaultnode); }
this must kind of race condition related angular directive provider.
Comments
Post a Comment