dijit/registry (version 1.10)

Summary

Registry of existing widget on page, plus some utility methods.

See the dijit/registry reference documentation for more information.

Property Summary

Method Summary

  • _destroyAll() Code to destroy all widgets and do other cleanup on page unload
  • add(widget) Add a widget to the registry.
  • byId(id) Find a widget by it's id.
  • byNode(node) Returns the widget corresponding to the given DOMNode
  • findWidgets(root,skipNode) Search subtree under root returning widgets found.
  • getEnclosingWidget(node) 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
  • getUniqueId(widgetType) Generates a unique id for a given widgetType
  • remove(id) Remove a widget from the registry.
  • toArray() Convert registry into a true Array

Properties

_hash
Defined by: dijit/registry
length
Defined by: dijit/registry

Number of registered widgets

Methods

_destroyAll()
Defined by dijit/registry

Code to destroy all widgets and do other cleanup on page unload

add(widget)
Defined by dijit/registry

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.

byId(id)
Defined by dijit/registry

Find a widget by it's id. If passed a widget then just returns the widget.

Parameter Type Description
id String | Widget
Returns:String|Widget
byNode(node)
Defined by dijit/registry

Returns the widget corresponding to the given DOMNode

Parameter Type Description
node DOMNode
Returns:undefined
findWidgets(root,skipNode)
Defined by dijit/registry

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:Array
getEnclosingWidget(node)
Defined by dijit/registry

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
Returns:undefined | null
getUniqueId(widgetType)
Defined by dijit/registry

Generates a unique id for a given widgetType

Parameter Type Description
widgetType String
Returns:string
remove(id)
Defined by dijit/registry

Remove a widget from the registry. Does not destroy the widget; simply removes the reference.

Parameter Type Description
id String
toArray()
Defined by dijit/registry

Convert registry into a true Array

Returns:Array

Examples

Example 1

Work with the widget .domNodes in a real Array

array.map(registry.toArray(), function(w){ return w.domNode; });
Error in the documentation? Can’t find what you are looking for? Let us know!