Module: delite/CustomElement

delite/CustomElement

require(["delite/CustomElement"], function (CustomElement) { new CustomElement(); })

Base class for all custom elements.

Use this class rather that Widget for non-visual custom elements. Custom elements can provide custom setters/getters for properties, which are called automatically when the value is set. For an attribute XXX, define methods _setXXXAttr() and/or _getXXXAttr()
Source:
Source:

Members

createdCallback

Some doc.
Source:

destroy

Destroy this class, releasing any resources registered via own().
Inherited From:
Source:

Methods

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.
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).
Source:

findCustomElements(Element)

Search subtree under root returning custom elements found.
Parameters:
Name Type Argument Description
Element <optional>
root Node to search under.
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 () { ... }).
Source:

own()

Track specified handles and remove/destroy them when this instance is destroyed, unless they were already removed/destroyed manually.
Inherited From:
Source:

processConstructorParameters()

Called after Object is created to process parameters passed to constructor.
Inherited From:
Source:

watch()

Watches a property for changes.
Inherited From:
Source: