PDA

View Full Version : Selection of first node of a tree is not happening



url
2 Apr 2013, 3:28 AM
Hi All,

I have created a tree panel by specifying the xtype as treecolumn. I want to select the first leaf of the tree as selected one. For this.
registered a boxready event and written the code like
boxready : function( treePanel, width, height, eOpts ){
debugger;
treePanel.getSelectionModel().select( 0 );
// treePanel.select( treePanel.getRootNode().getChildAt(0) );
treePanel.getSelectionModel().selected = 0;
},
treePanel.getSelectionModel() is giving me selectionmodel of type SINGLE.

Can any body please help me to identify where am missing?

Thanks
Url

url
3 Apr 2013, 9:03 PM
Hi All,
I got the solution , The problem was until the box was ready store is not loaded properly hence items are not there and selection was not happening.
So by writting the selection code inside the store.onLoad is helpful.




Thanks
Url