Opened 7 years ago

Closed 4 years ago

Last modified 3 years ago

#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 7 years ago by vtsuper

I would like to change the dojox.widget.standby's target dynamically, like this,

widget.set('target', 'targetWidgetID');

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

_setTargetAttr:function(target){
    if(typeof target === "string"){
        var w = registry.byId(target);
        this.target = w ? w.domNode : dom.byId(target);
    }
}

comment:2 Changed 7 years ago by bill

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:3 Changed 7 years ago by vtsuper

good~

hope I can see this minor enhancement soon~

comment:4 Changed 6 years ago by vtsuper

is it possible to put this minor changes into the ver 1.9????

comment:5 Changed 5 years ago by vtsuper

sorry wrong content~

Last edited 5 years ago by vtsuper (previous) (diff)

comment:6 Changed 4 years ago by dylan

Milestone: tbd1.11
Owner: changed from dante to dylan
Status: newassigned

comment:7 Changed 4 years ago by dylan

Priority: undecidedlow

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 4 years ago by dylans <dylan@…>

Resolution: fixed
Status: assignedclosed

In 8f016dc0b5c6141eb1c2533ca2c3d4d343f7d107/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:9 Changed 4 years ago by dylan

Thanks @vtsuper. This has been added to master and will be in Dojo 1.11.

comment:10 Changed 3 years ago by jandockxppw

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.

Note: See TracTickets for help on using tickets.