Opened 12 years ago
Closed 9 years ago
#10009 closed enhancement (fixed)
widget.getChildren() inconsistent return value
Reported by: | Les | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | 1.5 |
Component: | Dijit | Version: | 1.3.2 |
Keywords: | getChildren | Cc: | |
Blocked By: | Blocking: |
Description
Here are a few examples:
console.dir(dijit.byId('dijit__TreeNode_3').getChildren()) // NodeList console.dir(dijit.byId('fileMenu').getChildren()) // NodeList console.dir(dijit.byId('border1').getChildren()) // BorderContainer - Array console.dir(dijit.byId('ttabs').getChildren()) // TabContainer - NodeList console.dir(dijit.byId('myStackContainer').getChildren()) // Array console.dir(dijit.byId('dijit_layout_AccordionContainer_0').getChildren()) // Array
I prefer NodeLists? - they are easier to work with compared to plain arrays.
Change History (5)
comment:1 Changed 12 years ago by
Milestone: | tbd → future |
---|---|
Type: | defect → enhancement |
comment:2 Changed 12 years ago by
Beefed up array would be better b/c it tells me something about the order of widgets whereas WidgetSet? is unordered.
comment:4 Changed 11 years ago by
Milestone: | future → 2.0 |
---|
Will be "fixed" in 2.0 in the sense that we'll augment the Array object to have forEach(), map(), etc., like ie7-js does.
comment:5 Changed 9 years ago by
Milestone: | 2.0 → 1.5 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
I wouldn't use the word "inconsistent" as getChildren() always returns an array of widgets, according to spec.
For 2.0 we can consider changing it to return a WidgetSet or beefed up array, see #4122.