#6126 closed defect (invalid)
dijit.tree.TreeStoreModel.mayHaveChildren incorrectly implemented
Reported by: | guest | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Dijit | Version: | 1.1b1 |
Keywords: | mayHaveChildren, TreeStoreModel, ForestStoreModel | Cc: | |
Blocked By: | Blocking: |
Description
The current implementation uses: return dojo.some(this.childrenAttr, function(attr){
return this.store.hasAttribute(item, attr);
}, this);
but as this.childrenAttr is a string, every character is treated as an element of an array. For a childrenAttr like 'children', the function that will be executed is
return this.store.hasAttribute(item, 'c') return this.store.hasAttribute(item, 'h') return this.store.hasAttribute(item, 'i') ...
The correct, expected behaviour, occurs when wrapping the value this.childrenAttr in an Array, thus using the implementation:
return dojo.some([this.childrenAttr], function(attr){
return this.store.hasAttribute(item, attr);
}, this);
Change History (5)
comment:1 Changed 13 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 Changed 13 years ago by
PS: but I will change the variable name to be childrenAttrs so it's less confusing. Plus fix the comment to say String{].
No, it's an array, see the declaration: