PDA

View Full Version : Appending a child with children in node interface



pedwards
19 May 2014, 5:14 AM
Hi,

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



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

pedwards
19 May 2014, 6:08 AM
Why has this been moved to Q&A - are you saying it isn't a bug? If so, a comment would be nice! I put it in bugs as this is something that was working in extjs4.

Regards,
Paul

YannS
23 Jul 2014, 6:44 AM
Same issue for me, it's really a bug !
One possible solution but so slow: use appendChild for each child.