View Full Version : [ASK] Can't change leaf attribute in tree node ?

24 Mar 2011, 1:05 AM
Hi all.. I wan't to ask, why I can't change leaf attribute in tree node..
If I use alert to show leaf attribute for each node, it works. but I can't change its value..

for example, here is the code :

var record2 = function(treeLoader, node)
var nodes = tree.getRootNode().findChild('dfno', dfno);
nodes.eachChild(function(currentNode) // looping all children's root
alert(currentNode.attributes.dfno); // it works
alert(currentNode.attributes.leaf); // it works

currentNode.attributes.leaf = false; // it not works
currentNode.attributes.dfno = "dfdf"; // it now works
//currentNode.setText("dd"); // it works
treeLoader.on('load',record2, this);

that's my code.. when I loop all children's node, there's an alert show each child node's leaf and dfno..
but when I try to change leaf attribute using : currentNode.attributes.leaf = false;. that doesn't work..
and if I using currentNode.setText("dd");, it works..

I've look in API documentation, there's a method setText.. but i can't find method to change leaf attribute..:-?

please tell me how to do this? :-/
thx b4...

24 Mar 2011, 6:16 PM
somebody please help me... :-/