Registry of existing widget on page, plus some utility methods.
See the dijit/registry reference documentation for more information.
Code to destroy all widgets and do other cleanup on page unload
Add a widget to the registry. If a duplicate ID is detected, a error is thrown.
Parameter | Type | Description |
---|---|---|
widget | dijit/_WidgetBase | Any dijit/_WidgetBase subclass. |
Find a widget by it's id. If passed a widget then just returns the widget.
Parameter | Type | Description |
---|---|---|
id | String | Widget |
Returns the widget corresponding to the given DOMNode
Parameter | Type | Description |
---|---|---|
node | DOMNode |
Search subtree under root returning widgets found. Doesn't search for nested widgets (ie, widgets inside other widgets).
Parameter | Type | Description |
---|---|---|
root | DOMNode | Node to search under. |
skipNode | DOMNode | If specified, don't search beneath this node (usually containerNode). |
Returns the widget whose DOM tree contains the specified DOMNode, or null if the node is not contained within the DOM tree of any widget
Parameter | Type | Description |
---|---|---|
node | DOMNode |
Generates a unique id for a given widgetType
Parameter | Type | Description |
---|---|---|
widgetType | String |
Remove a widget from the registry. Does not destroy the widget; simply removes the reference.
Parameter | Type | Description |
---|---|---|
id | String |
Convert registry into a true Array
Work with the widget .domNodes in a real Array
array.map(registry.toArray(), function(w){ return w.domNode; });