PDA

View Full Version : Tree after reload not work properly



korndeang
15 Jul 2013, 12:01 AM
I have a tree with first time load it works fine, when i want reload tree any time, even json the same responded but my tree collapse ( it show only 1 level of child root) when i click on that child it will show all child like work normal, but all items become stuck could not click, all is crash, i think may be conflict.

Ext.getCmp('tree-role-panel').getStore().load()
i by googling many hours but no luck mostly other people just use above code works but me not any idea?

slemmon
16 Jul 2013, 12:20 PM
If you're returning the same dataset each time and it's appending to the nodes already in the tree you likely have a conflict with duplicate IDs on the nodes. You can get around this by setting another field to act as the primary ID using the idProperty on the model definition:
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.data.Model-cfg-idProperty