Caplin Trader 5.1.0

Class: module:br-presenter/control/tooltip/TooltipControl

module:br-presenter/control/tooltip/TooltipControl()

A presenter control that places a tooltip next to the field defined by the module:br-presenter/node/ToolTipNode. This class is constructed by presenter automatically on your behalf.

The TooltipControl must be used with a module:br-presenter/node/ToolTipNode. This presentation node represents the view element which will be the container of the tooltip box. This means, all the fields in which a tooltip will be displayed must be contained inside this element. Unlike a normal tooltip this automatically displays beside the specified field without the user having to hover over it.

The TooltipControl is aliased by br.tooltip, and can be used within templates as follows:

  <div data-bind="control:'br.tooltip', controlNode:tooltipNode">
  	<input class="tooltip-field1" />
  	<input class="tooltip-field2" />
  </div>

Keep in mind that only one html element must have the tooltip css class at a time. This is why we also provide a module:br-presenter/util/ErrorMonitor to control several br-presenter/node/TooltipField an deal with this. We recommend the use of this class for module:br-presenter/node/TooltipField monitoring.

Constructor

new module:br-presenter/control/tooltip/TooltipControl()

Implements:

Methods

destroy()

Called when the view is being disposed of to allow cleaning up of listeners and controls.

Implements:

setElement(eElement)

Sets the element in which the control will be rendered in.

Parameters:
Name Type Description
eElement Element

DOM element to use as the container for the control. Some controls will use this element as the actual control (progressive enhancement).

Implements:

setOptions(mOptions)

Sets the configuration options of the control.

Control configuration options passed within the HTML template are made available using this method. Control options can be passed within the HTML template like this:

<div id="dropDownSelectBox"
 data-bind="controlNode:selectionField, control:'ext-select-box', controlOptions:{width:95}">
</div>
Parameters:
Name Type Description
mOptions Object

A map of options

Implements:

setPresentationNode(oPresentationNode)

Sets the presentation node the control is being bound to.

It is the control adaptors responsibility to synchronize the presentation node with the control being adapted; any changes to the presentation node properties must be reflected in the control, and any user interactions with the control must be reflected in the presentation node.

Each control adaptor will typically be designed to work with a single type of presentation node, for example:

Authors are encouraged specify the presentation node type the control adaptor accepts within the package name (e.g. br-presenter/control/selectionfield/JQueryAutoCompleteControl), and to fail fast by throwing a module:br-presenter/control/InvalidControlModelError if they are bound to the wrong type of presentation node.

Parameters:
Name Type Description
oPresentationNode module:br-presenter/node/PresentationNode

The presentation node the control is being bound to.

Implements:
Throws:

if the wrong type of presentation node is used.

Type
br-presenter/control/InvalidControlModelError