PDA

View Full Version : Tree Nodes



Sneha004
10 Jun 2012, 10:35 PM
Hi,
Can any one give some idea how to disable all the treel nodes stored in the store by clicking on a button?

I have created one tree panel which is having one button as dockedItems of the treepanel.
By clicking on the button all the tree nodes should be disabled.

Is there any idea to do this, Plz give some solution

slemmon
11 Jun 2012, 6:47 AM
Does this work for you?



var store = Ext.create('Ext.data.TreeStore', {
root: {
expanded: true,
children: [
{ text: "detention", leaf: true },
{ text: "homework", expanded: true, children: [
{ text: "book report", leaf: true },
{ text: "alegrbra", leaf: true}
] },
{ text: "buy lottery tickets", leaf: true }
]
}
});


Ext.create('Ext.tree.Panel', {
title: 'Simple Tree',
width: 200,
height: 150,
store: store,
rootVisible: false,
renderTo: Ext.getBody()
, tbar: [{
text: 'disable'
, handler: function (btn) {
btn.up('treepanel').getView().disable();
}
}]
});