Looks like we can't reproduce the issue or there's a problem in the test case provided.
[4.2.0] Treepanel behaving really strange on appending a child with children included
Ext version tested:
Browser versions tested against:
- Firefox 19.0.2
- Chrome 25.0.1364.172
- The treepanel acts really strange, when adding an object with children (rendering the children inside AND outside of the parent node, duplicating them on collapse/expand of the parent node)
Steps to reproduce the problem:
The result that was expected:
- having the child nodes once under the parent node, even after collapse/expand
The result that occurs instead:
- the child nodes are rendered as child of the parent node AND as child of the root node
- on collapse/expand of the parent node, the child nodes are dpulicated
var view = Ext.create('Ext.tree.Panel',
Screenshot or Video:
See this URL for live test case:
- Bug seems to be in Ext.data.TreeStore in method onBeforeNodeExpand. changing "delete data[reader.root];" to "delete (node.raw || node[node.persistenceProperty])[reader.root];" solved the problem for me.
- see http://alexdelius.com/testcase/fixed.html
Additional CSS used:
Thanks for the report! I have opened a bug in our bug tracker.
Is there a workaround for this basic function that's broken?
Seems, @JTRipper suggests something in the "Possible fix" section. Have you tried it?
Just a note.
If expand nodes in a TreeStore's load listener, the issue can appear.
Adding a small delay for a load listener helps.