PDA

View Full Version : knowing when a treeview has finished expanding (4.2.1)



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();
}

WendyLG
27 Oct 2015, 1:47 AM
i don't want this falling off the first page

joel.watson
30 Oct 2015, 4:52 AM
Hi-

If you can share a test case that demonstrates the issue you're experiencing (https://fiddle.sencha.com), I'll be happy to test this along with you.

Thanks!
Joel