Opened 12 years ago

Closed 10 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:


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 bill

Milestone: tbdfuture
Type: defectenhancement

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.

comment:2 Changed 12 years ago by Les

Beefed up array would be better b/c it tells me something about the order of widgets whereas WidgetSet? is unordered.

comment:3 Changed 12 years ago by bill

Again, see #4122.

comment:4 Changed 11 years ago by bill

Milestone: future2.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 10 years ago by bill

Milestone: 2.01.5
Resolution: fixed
Status: newclosed

Actually, I believe this behavior was made consistent with [16904] and [22269].

Note: See TracTickets for help on using tickets.