Caplin Trader 5.1.0

Class: module:ct-control/basic/BasicControl

(abstract) module:ct-control/basic/BasicControl(controlType)

An implementation of Control and ControlFramework that acts as a base class for implementations of real controls.

Constructor

(abstract) new module:ct-control/basic/BasicControl(controlType)

Constructs a new BasicControl with the specified arguments.

This abstract class should never be constructed explicitly.

Parameters:
Name Type Description
controlType module:ct-control/factory/ControlType

The control type.

Implements:

Methods

addClass()

Implements:
See:

attachControlEventListener()

Implements:
See:

bind()

Implements:
See:

clear()

Implements:
See:
  • ct-control/Control#clear

clearState()

Implements:
See:

createFragment() → {Node}

Creates a fragment containing the control template

Returns:

The fragment

Type
Node

detachControlEventListener()

Implements:
See:

disable()

Implements:
See:

enable()

Implements:
See:

finalize()

Implements:
See:

flash()

Implements:
See:

focus()

Implements:
See:

getAttributes()

Implements:
See:

getElement() → {HTMLElement}

Gets the element associated with this control.

Returns:

the element associated with this control.

Type
HTMLElement

getFlashDuration() → {number}

Gets the value of the flash duration.

Implements:
Returns:

the value of the flash duration.

Type
number

getId() → {integer}

Gets the numeric id of this control.

Implements:
Returns:

The numeric id of this control.

Type
integer

getInitialClassName()

Implements:
See:

getNumericFlashDirection(newValue, oldValue) → {string}

Determines the numeric flash direction of the new value relative to the old value. If either new or old value is not a number (for example, if either value is undefined) then the function returns an empty string.

Parameters:
Name Type Description
newValue number

The new value.

oldValue number

The old value.

Returns:

'up', 'down' or 'flat' depending on whether the new value is respectively greater than, less than or equal to the old value.

Type
string

getValue()

Implements:
See:

initialize()

Implements:
See:

isBound() → {boolean}

Indicates whether the control is bound to an HTML Element.

Returns:

true if the control is bound to an HTML Element; otherwise false.

Type
boolean

isEnabled()

Implements:
See:

refresh()

Implements:
See:

removeClass()

Implements:
See:

removeFlash()

Removes the flash state from the control.

Implements:

replaceClass()

Implements:
See:

select()

Implements:
See:

setAttribute(name, value)

Sets a control attribute.

Parameters:
Name Type Description
name string

The name of the attribute to set.

value Variant

The value to set.

See:

setDomAttribute(attributeName, attributeValue)

Sets the given HTML attribute value on of the underlying HTML element.

Parameters:
Name Type Description
attributeName string

the HTML attribute name to be set.

attributeValue string

the HTML attribute value to set.

setDomClass(className)

Sets the DOM CSS classname of the underlying HTML element.

Parameters:
Name Type Description
className string

the CSS class name to set.

setDomParentClass(className)

Sets the DOM CSS classname of the underlying parent HTML element.

Parameters:
Name Type Description
className string

the CSS class name to set.

setDomStyle(styleName, styleValue)

Sets the given CSS style value on of the underlying HTML element.

Parameters:
Name Type Description
styleName string

the CSS style name to be set.

styleValue string

the CSS value to set.

(abstract) setDomValue(value)

Sets the value in the DOM. Implementing classes must specify how their DOM value will be set.

Parameters:
Name Type Description
value string

The value to set in the DOM.

setId(id)

Sets the id of this control.

Parameters:
Name Type Description
id integer

the value of the id to set.

Implements:

setInitialClassName()

Implements:
See:

setStyle()

Implements:
See:

setTooltip(tooltip)

Sets the tooltip value for this control.

Parameters:
Name Type Description
tooltip string

the tooltip value.

setValue()

Implements:
See:

toString()

Implements:
See:

unbind()

Implements:
See: