WendyLG
20 Oct 2015, 1:47 AM
I have a tree, i am re-applying the state to after a reload. what i want is to expand the nodes which need expanding, then focus and select on the previously selected node.
But what is happening is the expanded callback is called before the nodes have actually been expanded on screen, so the item is selected, focused, then scrolled out of view again when the nodes actually expand on screen
for(i =0; i < len; i++){
if(typeof nodes[i]!=='undefined'){
me._expansions ++;
me.expandPath(nodes[i],'text','/',function(){
me._expansions--;
if(me._expansions ===0&&!me._expanding){
me._reselect();// never get here as this is always called immediately
}
});
}
}
me._expanding =false;
if(me._expansions ===0){// belt and braces code supposedly but actually being called every time
me._reselect();
}
But what is happening is the expanded callback is called before the nodes have actually been expanded on screen, so the item is selected, focused, then scrolled out of view again when the nodes actually expand on screen
for(i =0; i < len; i++){
if(typeof nodes[i]!=='undefined'){
me._expansions ++;
me.expandPath(nodes[i],'text','/',function(){
me._expansions--;
if(me._expansions ===0&&!me._expanding){
me._reselect();// never get here as this is always called immediately
}
});
}
}
me._expanding =false;
if(me._expansions ===0){// belt and braces code supposedly but actually being called every time
me._reselect();
}