new module:ct-element /renderer /Single Stream Renderer()
A single stream renderer.
Extends:
Extends
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. |
- Inherited From:
- Implements:
bind(control Element)
Binds the renderer to the DOM and attaches any event listeners to the control.
Parameters:
Name | Type | Description |
---|---|---|
controlElement |
HTMLElement | The DOM element representing the renderer |
- Inherited From:
- Implements:
- See:
bind Handlers()
Binds event listeners to the control for all the handlers, which will result in a callbacks to the
onRendererEvent()
method then any event occurs.
- Inherited From:
clear()
Clears the renderer value and all associated state, including the displayed value. The renderer will remain bound to the DOM.
- Overrides:
- Implements:
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.
- Overrides:
- Implements:
create Html(field Values, class Name) → {HtmlEl ement|Document Fragment}
Returns an HTMLElement (or DocumentFragment) that defines this element.
This is the first of two steps required to bind a renderer to its corresponding HTML element. In fact, there are two ways of binding a renderer:
- The simplest way is to use the
module:ct-element/RendererFramework#getElement
helper method — this invokescreateHtml()
andmodule:ct-element/RendererFramework#bind
on your behalf. - A more performant mechanism for components that contain large numbers of renderers is to use
invoke
module:ct-element/RendererFramework#createHtml
andmodule:ct-element/RendererFramework#bind
yourself, so that the entire DOM strucutre for all renderers can be created using a single use call toappendChild
, allowing significant performance gains to be achieved.
This method must be called after the FieldModel
has been set using
FieldModel.setFieldModel()
. If the FieldModel
is populated with
some initial data for this renderer, then the HTML fragment returned will also contain that value, obviating
the need for an call to module:ct-element/Renderer#setValue
afterwards.
Parameters:
Name | Type | Description |
---|---|---|
fieldValues |
Map | The field values |
className |
string | The HTML class attribute (a space separated list) |
- Inherited From:
- Implements:
- See:
Returns:
The HTML fragment.
- Type
-
Html
Element | Document Fragment
disable()
Disables the renderer control. Does nothing if the control has no concept of enabled/disabled.
- Inherited From:
- Implements:
enable()
Enables the renderer control. Does nothing if the control has no concept of enabled/disabled.
- Inherited From:
- Implements:
finalize()
Releases any renderer resources and resets its state.
- Inherited From:
- Implements:
focus()
Moves the focus to this renderer. Does nothing if the control has no concept of focus.
- Inherited From:
- Implements:
get All Field Names() → {Array}
Returns a complete list of all field names that the renderer depends on.
- Inherited From:
- Implements:
Returns:
The field names.
- Type
- Array
get Control() → {module:ct-control /Control}
Returns a control corresponding to the renderer.
- Inherited From:
Returns:
The control
get Element() → {Element}
Returns the element that this renderer is associated with.
If the renderer binding was not performed manually using module:ct-element/RendererFramework#createHtml
and module:ct-element/RendererFramework#bind
,
then this helper method will do this automatically on your behalf.
- Inherited From:
- Implements:
- See:
-
- module:ct-element/RendererFramework#createHTML
- module:ct-element/RendererFramework#bind
- module:ct-element/RendererFramework#unbind
Returns:
The element associated with this renderer.
- Type
- Element
get Field Values() → {Map}
Returns the fields relating to the currently displayed value.
- Inherited From:
- Implements:
Returns:
The field values.
- Type
- Map
get Formatted Value() → {Variant}
Returns the formatted downstream value.
- Inherited From:
- Implements:
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").
- Inherited From:
- Implements:
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").
- Inherited From:
- Implements:
Returns:
The renderer's namespace.
- Type
- string
get Parsed Value() → {Variant}
Returns the parsed upstream value.
- Overrides:
- Implements:
Returns:
The parsed upstream value.
- Type
- Variant
get Primary Field Names() → {Array.< string>}
Returns a list of primary fields.
- Inherited From:
- Implements:
Returns:
The field names.
- Type
-
Array
.<string>
get Serial Id() → {string}
Returns the serial id of the renderer instance.
- Inherited From:
- Implements:
Returns:
The renderer serial id.
- Type
- string
get Unformatted Value() → {Variant}
Returns the unformatted downstream value.
- Inherited From:
- Implements:
Returns:
The unformatted downstream value.
- Type
- Variant
get Unparsed Value() → {Variant}
Returns the unparsed upstream value.
- Inherited From:
- Implements:
Returns:
The unparsed upstream value.
- Type
- Variant
get Variable(variable Name) → {String}
Gets the renderer's variable.
Parameters:
Name | Type | Description |
---|---|---|
variableName |
String | The variable name to retrieve. |
- Inherited From:
Returns:
The variable value
- Type
- String
initialize(initial Field Values)
Initializes the renderer and sets its state according to the supplied field values.
Parameters:
Name | Type | Description |
---|---|---|
initialFieldValues |
Map | The initial field values |
- Inherited From:
- Implements:
is Bound() → {boolean}
Returns true if the renderer has been bound to the DOM.
- Inherited From:
- Implements:
- See:
Returns:
True if the renderer has been bound to the DOM, or false otherwise.
- Type
- boolean
on Renderer Event(dom Event)
Event handler callback function that receives the events attached to the controls and defined in the handlers.
All control events call this function.
Parameters:
Name | Type | Description |
---|---|---|
domEvent |
object | The DOM event that was fired |
- Inherited From:
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. |
- Inherited From:
- Implements:
refresh()
Apply all pending updates
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. |
- Inherited From:
- Implements:
select()
Moves the focus and highlights this renderer. Does nothing if the control has no concept of focus.
- Inherited From:
- Implements:
set Name(name)
Sets the renderer's name.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The renderer's name. |
- Inherited From:
- Implements:
set Namespace(namespace)
Sets the renderer's namespace.
Parameters:
Name | Type | Description |
---|---|---|
namespace |
string | The renderer's namespace. |
- Inherited From:
- Implements:
set Serial Id(serial Id)
Sets the serial id.
Parameters:
Name | Type | Description |
---|---|---|
serialId |
int | The serial id |
- Inherited From:
to String() → {string}
Returns a human-readable string representation of the object, which is useful for debugging.
Returns:
The string representation
- Type
- string
unbind()
Unbinds the renderer from the DOM and detaches any event listeners to the control.
- Inherited From:
- Implements:
- See:
unbind Handlers()
Unbinds event listeners from the control for all the handlers.
- Inherited From:
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. |
- Inherited From:
- Implements:
update Stream Values(field Values)
Parameters:
Name | Type | Description |
---|---|---|
fieldValues |
Map |