lundi 19 mai 2014

Appending a child with children in node interface

Hi,

I used to append a child that contained children in the extjs4 and it worked. Now it doesn't! Here is an example:



Code:



new Ext.tree.Panel({ renderTo: document.body,
width: 300,
height: 300,
title: 'rootchange Event Test',
store: {
root: {
text: 'Root',
expanded: true,
children: [{
text: 'Foo',
leaf: true
}]
}
},
dockedItems: [{
xtype: 'toolbar',
dock: 'top',
items: [{
text: 'appendChild',
handler: function(button) {
var tree = button.up('treepanel'),
store = tree.getStore(),
root = store.getRootNode();

root.appendChild({
text: 'Bar',
expanded: true,
children: [{
text: 'Baz',
leaf: true
}]
});


}
}]
}]
});

Regards,

Paul


Aucun commentaire:

Enregistrer un commentaire