Opened 11 years ago

Closed 11 years ago

#8810 closed defect (fixed)

widget.getChildren() not consistent with dijit.getChildren(widget.domNode)

Reported by: Les Owned by:
Priority: high Milestone: 1.3
Component: Dijit Version: 1.3.0b2
Keywords: Cc:
Blocked By: Blocking:

Description

This is based on the nightly build.

Steps to recreate:

  1. Enter:

http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/layout/test_BorderContainer_complex.html

  1. Evaluate the following code in Firebug:
    widget = dijit.byId('dijit_layout_BorderContainer_0')
    console.log(widget.getChildren().length);
    console.log(dijit.getChildren(widget.domNode).length);
    

You will see 5 and 10 in the log. I believe a call to widget.getChildren() dijit.getChildren(widget.domNode) should return the same number of widgets. Otherwise, dijit.getChildren function should be renamed to avoid this inconsistency.

Also see forum entry: http://dojotoolkit.org/forum/dijit-dijit-0-9/dijit-development-discussion/dijit-getchildren-confusing

Change History (3)

comment:1 Changed 11 years ago by Les

Correction: I believe a call to widget.getChildren() AND dijit.getChildren(widget.domNode) should return the same number of widgets.

comment:2 Changed 11 years ago by bill

I added a comment to your forum post. The function is working correctly. I could change the name to something less confusing if you give a suggestion as to what, but not getDescendants(), because that implies finding nested widgets.

comment:3 Changed 11 years ago by bill

Milestone: tbd1.3
Resolution: fixed
Status: newclosed

Fixed in [16998]: Rename dijit.getChildren() to dijit.findWidgets() to avoid confusion with _Widget.getChildren().

Note: See TracTickets for help on using tickets.