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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -