Opened 9 years ago
Closed 9 years ago
#15066 closed enhancement (fixed)
childWidget.placeAt(parentWidget) should call childWidget.startup()
Reported by: | bill | Owned by: | bill |
---|---|---|---|
Priority: | undecided | Milestone: | 1.8 |
Component: | Dijit | Version: | 1.7.2 |
Keywords: | Cc: | ykami, cjolif | |
Blocked By: | Blocking: |
Description (last modified by )
If parentWidget is already started, then childWidget.placeAt(parentWidget) should call childWidget.startup(), same as happens with addChild().
In actuality, childWidget.startup() is only called in parentWidget extends dijit._Container and thus has an addChild() method.
Change History (6)
comment:1 Changed 9 years ago by
Milestone: | tbd → 1.8 |
---|---|
Owner: | set to bill |
Status: | new → assigned |
Type: | defect → enhancement |
comment:2 Changed 9 years ago by
Cc: | ykami cjolif added |
---|
comment:3 Changed 9 years ago by
Description: | modified (diff) |
---|
comment:4 follow-up: 5 Changed 9 years ago by
comment:5 Changed 9 years ago by
Replying to neonstalwart:
i'm still confused about what this ticket is tracking.
childWidget.placeAt(parentWidget)
callsparentWidget.addChild(childWidget)
Sometimes it does, sometimes it doesn't. That addChild() is inside an if() statement. I am talking about the }else{ branch.
are you suggesting that the code in
placeAt
should also try to callstartup
in addition to thestartup
call inaddChild
?
No.
maybe you're suggesting that if
placeAt
is passed a DOM node it should see if the node has an enclosing widget and then start the child widget -
Not really. I'm talking about when placeAt() is passed a widget that doesn't have an addChild() method.
i'm still confused about what this ticket is tracking.
childWidget.placeAt(parentWidget)
callsparentWidget.addChild(childWidget)
which for aparentWidget
that inherits from_Container
it already callsstartup
. is there some specificaddChild
functions in classes that don't inherit from_Container
that aren't callingstartup
? i couldn't find any in dijit.are you suggesting that the code in
placeAt
should also try to callstartup
in addition to thestartup
call inaddChild
?maybe you're suggesting that if
placeAt
is passed a DOM node it should see if the node has an enclosing widget and then start the child widget - ie you meant to putchildWidget.placeAt(parentWidget.containerNode)
in the description? that's interesting but doesn't seem right. i may have a TabContainer? and i want to place several children in mycontainerNode
viachild.placeAt(this.containerNode)
but i only wantchild.startup
to be called when the child is first shown. this would break if you're suggesting thatchildWidget.placeAt(parentWidget.containerNode)
should callstartup
.i think that for consistency
addChild
should always be managing the call tostartup
so that widgets added viaparent.addChild(child);
work the same aschild.placeAt(parent);
andplaceAt
should just calladdChild
(as it does now). this also allows for a delayed startup to be managed by the container as necessary.unless you mean
childWidget.placeAt(aDomNode)
to callstartup
then it seems the only thing left is to ensure that alladdChild
functions callstartup
. a quick search of dojox shows the following exceptions