Opened 11 years ago

Closed 8 years ago

#8921 closed enhancement (wontfix)

dijit.onWidget idea

Reported by: Nathan Toone Owned by:
Priority: lowest Milestone: future
Component: Dijit Version: 1.3.0b3
Keywords: Cc:
Blocked By: Blocking:

Description

Sometimes, you know the id of a node (which will eventually be the id of the widget) - but when you want to use it, the widget isn't available. An example is if you want to reference a widget, during parsing, that may or may not be already instantiated (but at some point in the future will be).

A function with the following signature is helpful:

dijit.onWidget = function(widgetNodeOrId, callback)

It would take either a widget, a node, or an id, and call the callback when the widget is instantiated (or immediately if it's already instantiated).

Change History (3)

comment:1 Changed 11 years ago by Nathan Toone

An example implementation exists in the test file at http://bugs.dojotoolkit.org/attachment/ticket/6493/test_rangeValidate.html

comment:2 Changed 10 years ago by Nathan Toone

Owner: Nathan Toone deleted

Unassigning my tickets.

comment:3 Changed 8 years ago by bill

Resolution: wontfix
Status: newclosed

This can be done in user code with something like

aspect.after(_WidgetBase, "create", function(){
    if(this.id == id) callback();
}, true);

Admittedly that's not as nice as a specialized function, but given that I haven't heard other requests for this feature I'm going to close the ticket.

Note: See TracTickets for help on using tickets.