Caplin Trader 5.1.0

Interface: module:ct-control/factory/ControlFramework

module:ct-control/factory/ControlFramework

The ControlFramework interface specifies those lifecycle functions that are necessary for a control implementation to be managed by the Control Framework.

Methods

attachControlEventListener(eventName, renderer)

Attaches an event listener to the control. When the event occurs on the control then the onRendererEvent callback will be invoked on the supplied renderer.

Parameters:
Name Type Description
eventName String

The event name such as 'click', 'change', 'mouseover' etc.

renderer module:ct-element/Renderer

The renderer

bind(controlElement, isDummyopt)

Binds the DOM control.

Parameters:
Name Type Attributes Description
controlElement HtmlElement

The DOM element which represents the control.

isDummy boolean <optional>

true if the supplied control is a dummy.

createHtml(value) → {HTMLElement|DocumentFragment}

Creates an HTML fragment using the supplied control value.

Parameters:
Name Type Description
value Variant

The field vale to display.

Returns:

The HTML element or document fragment

Type
HTMLElement | DocumentFragment

detachControlEventListener(eventName)

Detaches event listeners from the control.

Parameters:
Name Type Description
eventName String

The event name such as 'click', 'change', 'mouseover' etc.

finalize()

Releases any resources and unbinds the control from the DOM.

getInitialClassName() → {String}

Gets the initial class name.

Returns:

The initial class name.

Type
String

initialize()

Initializes the control, clearing any cached value and cached CSS styling information.

setInitialClassName(initialClassName)

Sets the initial class name.

Parameters:
Name Type Description
initialClassName String

The HTML class attribute (a space separated list).

unbind()

Unbinds the DOM control.