Class

Component

Component(parent, id, setupData)

Class representing a abstract view.
Constructor

# new Component(parent, id, setupData)

Create an abstract view component.
Parameters:
Name Type Description
parent object The parent component object.
id string The id should be a unique string idetifier.
setupData object Deprecated paramenter will be removed in future.

View Source component.js, line 6

Classes

Component

Methods

# addDomElement(tag) → {object}

Add a DOM element with an optional CSS class.
Parameters:
Name Type Description
tag string The HTML tag to be created.

View Source component.js, line 185

The DOM element.
object

# addElementClasslist(classList)

Helper method for adding classes to an DOM element.
Parameters:
Name Type Description
classList string One ore more class names separated with spaces.

View Source component.js, line 208

# build()

Build the DOM element(s) of a customized component. This method has to be overriden by derived classes.

View Source component.js, line 35

# buildChilds()

Build all descendant components.

View Source component.js, line 74

# buildDOM()

Build the DOM element(s).

View Source component.js, line 51

# countDescendants() → {number}

Count all descendant components. Descendants are children, grandchildren, and so on.

View Source component.js, line 151

Number of descendants.
number

# createDomElement(tag) → {object}

Create a DOM element with an optional CSS class.
Parameters:
Name Type Description
tag string The HTML tag to be created.

View Source component.js, line 175

The DOM element.
object

# getComponentById(id) → {Component}

Get component by id.
Parameters:
Name Type Description
id string The id of the component to find.

View Source component.js, line 129

The found component or null, if no component has the given id.
Component

# getDomElement(selector) → {HTMLElement}

Retrieve an element from the DOM.
Parameters:
Name Type Description
selector string DOM selector to the element.

View Source component.js, line 199

The DOM element or null.
HTMLElement

# getPropertyNames(customPropertyNames) → {array}

Get property names.
Parameters:
Name Type Description
customPropertyNames array An array with the names of a derived class.

View Source component.js, line 86

An array with property names or undefined, if no properties exist.
array

# handleMessage(message)

Handles a message send to the component.
Parameters:
Name Type Description
message string The message to be handled.

View Source component.js, line 166

# propertiesChanged()

Update component after changes to it. This method has to be overriden by derived classes. This method will be called, when properties has been changed. The component has to reflect the changes in its visual representation.

View Source component.js, line 45

# setProperties(data)

Set component properties by data.
Parameters:
Name Type Description
data array An array with data in the form of name/value pairs.

View Source component.js, line 102