#16544 closed enhancement (fixed)
dynamic change the dojox.widget.standby TARGET
Reported by: | vtsuper | Owned by: | dylan |
---|---|---|---|
Priority: | low | Milestone: | 1.11 |
Component: | DojoX Widgets | Version: | 1.8.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
To reduce the resource, I would like to build 1 standby widget and share it in my whole application.
the target attribute can be a widget ID. So I want to change it dynamically. but the result is negative widget.set('target',newWidget);
the problem is there are no _setTargetAttr method. So we just add it then it becomes perfect
_setTargetAttr:function(target){ if(typeof target === "string"){ var w = registry.byId(target); this.target = w ? w.domNode : dom.byId(target); } }
Change History (10)
comment:1 Changed 8 years ago by
comment:2 Changed 8 years ago by
Seems good, except the third-to-last line should technically be:
this._set("target", w ? w.domNode : dom.byId(target));
so that watch() works.
comment:6 Changed 5 years ago by
Milestone: | tbd → 1.11 |
---|---|
Owner: | changed from dante to dylan |
Status: | new → assigned |
comment:7 Changed 5 years ago by
Priority: | undecided → low |
---|
I hope to get to this ticket in time for 1.11 (setting a deadline of end of January). If not, this will get moved to 1.12.
comment:8 Changed 5 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:9 Changed 5 years ago by
Thanks @vtsuper. This has been added to master and will be in Dojo 1.11.
comment:10 Changed 4 years ago by
This breaks existing behaviour. _setTargetAttr has no else branch. When our existing code sets a DOM node, nothing happens with this version.
I opened #18906 for this.
I would like to change the dojox.widget.standby's target dynamically, like this,
Although it seems works, it treats the targetWidgetID as a domNode ID rather than a widget ID.
So we can simply create a _setTargetAttr method, it becomes perfect