PDA

View Full Version : No selection for TreeNode after node.select()



Michael J.
26 Apr 2011, 5:01 AM
Hello. I want a make tree nodes autoselect by its id when user select something in other panel
What I`ve done -


// 'this' points to my object
// id is already set to existing node id

this.currentNode = this.comTree.getNodeById(this.id);
if(this.currentNode){
this.currentNode.ensureVisible(
function(){
this.comTree.getSelectionModel().select(this.currentNode);
}, this)
}


so the ensureVisible expand the tree part where my leaf is, then I want it to be selected by callback function after it is expanded, but no selection happens with error

"Ext.fly(node.ui.wrap) is null"

I`ve tried also in callback function simple



this.currentNode.select();


but it cause error:
"root is undefined"