PDA

View Full Version : Tree new loading



Henni
23 Sep 2011, 10:05 AM
Hello,

I load a Tree from a Json File.
Then I checked a Node starts a listener Function "checkchange". I want to change the cls attribut from the node in this function (change the color for example). Then the tree show automatically the new Color from the Node. I tried a lot but the tree show not the changes.

Can someone help me. Thanks.

Code from the MVC "View"

Ext.define('RTD.view.tree.ObjectSelection',
{
extend: 'Ext.tree.Panel',
alias : 'widget.ObjectSelection',

store: 'DistrictObjectTypeTree',


rootVisible: true,
useArrows: true,
frame: true,

listeners:
{
'checkchange': function(node, checked)
{
this.tree= Ext.widget('ObjectSelection');
var n = node;
n.data.cls = 'newClass';
alert(n.data.cls);
this.tree.getLoader().load();
this.tree.doLayout();
this.tree.load();


28280

fbchen
24 Sep 2011, 1:07 AM
The tree node adds a default class 'x-tree-checked' upon the tree node is checked, so just define your css style. Try this:
.x-tree-checked {
text-decoration: line-through;
color: red;
}