PDA

View Full Version : [FIXED] Tree - contradictory inline code documentation



LesJ
7 Apr 2014, 5:43 AM
These two inline comments clearly contradict each other. The tree store already has a link to the tree in bindStore, so why are you concerned about it in initComponent?

See also this thread (http://www.sencha.com/forum/showthread.php?283869-Problem-Mixing-of-structure-and-state-information-in-treenodes) and this thread (http://www.sencha.com/forum/showthread.php?280993-Nightly-Tree-panel-question&p=1027456&viewfull=1&langid=4).


Ext.define('Ext.tree.Panel', {
...
initComponent: function() {
...
// The TreeStore needs to know about ths singleExpand constrain so that it can ensure compliance.
// Otherwise it would have to have knowledge of an owning TreePanel.
me.store.singleExpand = me.singleExpand;
...
},
...
bindStore: function(store, initial) {
...
// TreeStore must have an upward link to the TreePanel so that nodes can find their owning tree in NodeInterface.getOwnerTree
store.ownerTree = me;
...
},
...

Animal
8 Apr 2014, 1:12 PM
Yes, the comment in initComponent is outdated.

It was attempting to maintain separation under the idea that a Store could be shared.

With trees, a TreeStore cannot be shared. The records have parent, child and sibling pointers and state information in them which indelibly roots them in one tree.

So in fact an upward link to an owning tree is valid in a TreeStore

Animal
8 Apr 2014, 1:16 PM
Thanks for the report! I have opened a bug in our bug tracker.