Opened 12 years ago
Closed 9 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 12 years ago by
comment:3 Changed 9 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
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.
An example implementation exists in the test file at http://bugs.dojotoolkit.org/attachment/ticket/6493/test_rangeValidate.html