PDA

View Full Version : Highligting the root node of the tree by default.



kavyakn
12 Apr 2012, 1:08 AM
Hi ,
Could you please tell me how to highlight the root node of the tree , during initial loading of the tree or by default root node of the tree should be highlighted ?

friend
12 Apr 2012, 9:08 AM
You can do this in the load event of your Tree's Store:



{
xtype: 'treepanel',
store: {
xtype: 'store.tree',
listeners: {
load: function(treestore, node, records, successful, eOpts) {
Ext.ComponentQuery.query('treepanel')[0].getSelectionModel().select(0, 0);
}
},
proxy: {
type: 'ajax',
url: 'menu/load.action',
reader: {
type: 'json'
}
}
}