require(["delite/Container"], function (Container) { new Container(); })
- Source:
- Source:
Members
-
containerNode :DomNode
-
Designates where children of the source DOM node will be placed. "Children" in this case refers to both DOM nodes and widgets.
containerNode must be defined for any widget that accepts innerHTML (like ContentPane or BorderContainer or even Button), and conversely is undefined for widgets that don't, like TextBox.
Type:
- DomNode
- Inherited From:
- Default Value:
- undefined
- Source:
-
focused :boolean
-
This widget or a widget it contains has focus, or is "active" because it was recently clicked.
Type:
- boolean
- Inherited From:
- Default Value:
- false
- Source:
-
register :delite/register
-
Convenience pointer to register class. Used by buildRendering() functions produced from handlebars! / template.
Type:
- delite/register
- Inherited From:
- Source:
Methods
-
addChild(widget, insertIndex)
Makes the given widget or DOM node a child of this widget.
-
Inserts specified child widget or DOM node as a child of this widget's container node, and possibly does other processing (such as layout).
Parameters:
Name Type Argument Description widget
DOMNode A description for widget insertIndex
int <optional>
A description for insertIndex - Source:
-
attachedCallback()
-
Called when the widget is first inserted into the document. If widget is created programatically then app must call startup() to trigger this method.
- Inherited From:
- Source:
-
buildRendering()
-
Construct the UI for this widget, filling in subnodes and/or text inside of this. Most widgets will leverage delite/handlebars! to implement this method.
- Inherited From:
- Source:
-
createdCallback()
-
Kick off the life-cycle of a widget.
- Inherited From:
- Source:
-
defer(fcn, delay)
-
Wrapper to setTimeout to avoid deferred functions executing after the originating widget has been destroyed. Returns an object handle with a remove method (that returns null) (replaces clearTimeout).
Parameters:
Name Type Description fcn
Object Function reference. delay
Object Delay, defaults to 0. - Inherited From:
- Source:
-
destroy()
-
Destroy this widget and its descendants.
- Inherited From:
- Source:
-
emit()
Signal that a synthetic event occurred, ex:
myWidget.emit("attrmodified-selectedChildWidget", {}).
-
Emits an event of specified type, based on eventObj. Also calls onType() method, if present, and returns value from that method. Modifies eventObj by adding missing parameters (bubbles, cancelable, widget).
- Inherited From:
- Source:
-
findCustomElements(Element)
-
Search subtree under root returning custom elements found.
Parameters:
Name Type Argument Description Element
<optional>
root Node to search under. - Inherited From:
- Source:
-
getChildren()
-
Returns all direct children of this widget, i.e. all widgets or DOM node underneath this.containerNode whose parent is this widget. Note that it does not return all descendants, but rather just direct children.
The result intentionally excludes internally created widgets (a.k.a. supporting widgets) outside of this.containerNode.
- Inherited From:
- Source:
-
getEnclosingWidget()
-
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
- Inherited From:
- Source:
-
getIndexOfChild()
-
Gets the index of the child in this container or -1 if not found
- Source:
-
getNextSibling()
-
Returns null if this is the last child of the parent, otherwise returns the next element sibling to the "right".
- Source:
-
getParent()
-
Returns the parent widget of this widget.
- Inherited From:
- Source:
-
getPreviousSibling()
-
Returns null if this is the first child of the parent, otherwise returns the next element sibling to the "left".
- Source:
-
hasChildren()
-
Returns true if widget has child widgets, i.e. if this.containerNode contains widgets.
- Source:
-
isFocusable()
-
Return true if this widget can currently be focused and false if not
- Inherited From:
- Source:
-
isLeftToRight()
-
Return this widget's explicit or implicit orientation (true for LTR, false for RTL)
- Inherited From:
- Source:
-
mix()
-
Set a hash of properties on a Stateful instance
- Inherited From:
- Source:
Example
myObj.mix({ foo: "Howdy", bar: 3 })
-
on()
-
Call specified function when event occurs, ex: myWidget.on("click", function () { ... }).
- Inherited From:
- Source:
-
onBlur()
-
Called when the widget stops being "active" because focus moved to something outside of it, or the user clicked somewhere outside of it, or the widget was hidden.
- Inherited From:
- Source:
-
onFocus(e)
-
Called when the widget becomes "active" because it or a widget inside of it either has focus, or has recently been clicked.
Parameters:
Name Type Description e
event A focus event. - Inherited From:
- Source:
-
own()
-
Track specified handles and remove/destroy them when this instance is destroyed, unless they were already removed/destroyed manually.
- Inherited From:
- Source:
-
placeAt(reference, position)
Place this widget somewhere in the DOM based on standard domConstruct.place() conventions.
-
A convenience function provided in all _Widgets, providing a simple shorthand mechanism to put an existing (or newly created) Widget somewhere in the dom, and allow chaining.
Parameters:
Name Type Argument Description reference
String | DomNode | Widget Widget, DOMNode, or id of widget or DOMNode position
String | Int <optional>
If reference is a widget (or id of widget), and that widget has an ".addChild" method, it will be called passing this widget instance into that method, supplying the optional position index passed. In this case position (if specified) should be an integer. If reference is a DOMNode (or id matching a DOMNode but not a widget), the position argument can be a numeric index or a string "first", "last", "before", or "after", same as dojo/dom-construct::place().
- Inherited From:
- Source:
-
postCreate()
Processing after the DOM fragment is created
-
Called after the DOM fragment has been created, but not necessarily added to the document. Do not include any operations which rely on node dimensions or placement.
- Inherited From:
- Source:
-
preCreate()
-
Processing before buildRendering()
- Inherited From:
- Source:
-
processConstructorParameters()
-
Called after Object is created to process parameters passed to constructor.
- Inherited From:
- Source:
-
removeChild(widget)
-
Removes the passed widget instance from this widget but does not destroy it. You can also pass in an integer indicating the index within the container to remove (ie, removeChild(5) removes the sixth widget).
Parameters:
Name Type Description widget
Element | int - Source:
-
startup()
Processing after the DOM fragment is added to the document
-
Called after a widget and its children have been created and added to the page, and all related widgets have finished their create() cycle, up through postCreate().
Note that startup() may be called while the widget is still hidden, for example if the widget is inside a hidden deliteful/Dialog or an unselected tab of a deliteful/TabContainer. For widgets that need to do layout, it's best to put that layout code inside resize(), and then extend delite/_LayoutWidget so that resize() is called when the widget is visible.
- Inherited From:
- Source:
-
watch()
-
Watches a property for changes.
- Inherited From:
- Source: