A Renderer
transforms machine readable data to a screen module:ct-control/Control
, and
captures user gestures which are then communicated back to one or more
module:ct-element/RendererEventListener
s.
This interface allows module:ct-element/Handler
s to interact with the Renderer
.
Methods
add Renderer Event Listener(renderer Event Listener)
Adds a module:ct-element/RendererEventListener
to which the Renderer will communicates user-gestures.
Parameters:
Name | Type | Description |
---|---|---|
rendererEventListener |
module:ct-element |
The renderer event listener. |
clear()
Clears the renderer value and all associated state, including the displayed value. The renderer will remain bound to the DOM.
clear State()
Clears the renderer state without clearing the displayed value. This is a performant version of clear for when you are going to update the displayed value immediately after clearing.
disable()
Disables the renderer control. Does nothing if the control has no concept of enabled/disabled.
enable()
Enables the renderer control. Does nothing if the control has no concept of enabled/disabled.
focus()
Moves the focus to this renderer. Does nothing if the control has no concept of focus.
get Field Values() → {Map}
Returns the fields relating to the currently displayed value.
Returns:
The field values.
- Type
- Map
get Formatted Value() → {Variant}
Returns the formatted downstream value.
Returns:
The formatted downstream value.
- Type
- Variant
get Name() → {string}
Returns the renderer name.
This is set by the framework that instantiates the Renderer (e.g. the grid) and represents the field context (e.g. "Bid Price").
Returns:
The renderer's name.
- Type
- string
get Namespace() → {string}
Returns the renderer namespace.
This is set by the framework that instantiates the Renderer (e.g. the grid) and represents the record context (e.g. "/FX/GBPUSD").
Returns:
The renderer's namespace.
- Type
- string
get Parsed Value() → {Variant}
Returns the parsed upstream value.
Returns:
The parsed upstream value.
- Type
- Variant
get Unformatted Value() → {Variant}
Returns the unformatted downstream value.
Returns:
The unformatted downstream value.
- Type
- Variant
get Unparsed Value() → {Variant}
Returns the unparsed upstream value.
Returns:
The unparsed upstream value.
- Type
- Variant
get Value()
Gets the renderer value.
Returns:
vRendererValue The renderer value.
is Enabled() → {boolean}
Determines whether the control is enabled.
Returns:
if the control is enabled.
- Type
- boolean
raise Event(sType, mRenderer Event)
Raises a renderer event.
Parameters:
Name | Type | Description |
---|---|---|
sType |
string | The renderer event type. |
mRendererEvent |
Map | The renderer event to raise. |
remove Renderer Event Listener(renderer Event Listener)
Removes a module:ct-element/RendererEventListener
to which the Renderer will communicate user-gestures.
Parameters:
Name | Type | Description |
---|---|---|
rendererEventListener |
module:ct-element |
The renderer event listener. |
select()
Moves the focus and highlights this renderer. Does nothing if the control has no concept of focus.
set Value(vRenderer Value)
Sets the renderer value.
Parameters:
Name | Type | Description |
---|---|---|
vRendererValue |
Variant | The renderer value. |
to String() → {string}
Returns a human-readable string representation of the renderer, which is useful for debugging.
Returns:
The string representation
- Type
- string
update Fields(field Values)
Updates the renderer with the supplied fields. The field values will be reflected in the control on the next call to {module:ct-element/Renderer#refresh}.
The Renderer might depend on these fields either because it has been bound to them in the constructor, or if the XML renderer definition refers to these fields using the ${} notation.
Additional field values can be supplied and they will have no effect on the displayed value, but they will be returned by {module:ct-element/Renderer#getFieldValues}. This can exploited to hold additional information about the value (such as price ID or timestamp).
Parameters:
Name | Type | Description |
---|---|---|
fieldValues |
Map | the new field values. |
update Field Values(field Values)
Updates the field values.
Parameters:
Name | Type | Description |
---|---|---|
fieldValues |
Map | The field values. |