PDA

View Full Version : TreePanel problem



Cp_Barbossa
25 May 2011, 6:04 AM
Hello.

I am new in ExtJS.
I'm using Ext 3.3 TreePanel, i have static nodes.

So, i'm trying to change node icon on Click event, here is part of my code:

new Ext.tree.TreePanel({
id: 'tree',
useArrows: true,
animate: true,
enableDD: false,
enableDrag: false,
containerScroll: true,
enableDrop: false,
border: true,
rootVisible: false,
listeners: {
click: function (node, e) {
node.attributes.iconCls = 'icon_checked';
Ext.getCmp('tree').getRootNode().reload();
}
},
root: new Ext.tree.AsyncTreeNode({
expanded: true,
text: 'root',
children: [{
id: 'node1', text: 'first', leaf: true, iconCls: 'icon_unchecked'
}, {
id: 'node2', text: 'second', leaf: true, iconCls: 'icon_unchecked'
}, {
id: 'node3', text: 'third', leaf: true, iconCls: 'icon_unchecked'
}]
})
})

the icon is changing, but Firefox throws error: node.ui is null.
am i missing somethig?