samedi 5 avril 2014

Why on node append to TreeStore leaf property not change?

When we append a node in another node that was a leaf, I think it should not be a leaf any more, however this doesn't happen! Why?



Ext: 4.2.1



var tree = Ext.create('Ext.data.TreeStore',{

fields: [{name: 'text'}],

proxy: {

type: 'memory',

data: [ {id: 1, text: 'test', leaf: true}]

}

});





tree.load({callback: function(){

var node = tree.getNodeById( 1 );

console.log( node.isLeaf() );

node.appendChild({id: 2, text: 'test 2', leaf: true});

console.log( node.isLeaf() );

}});




Aucun commentaire:

Enregistrer un commentaire