Caplin Trader 4.7.1

Class: module:caplin/grid/SyntheticGridDataProvider

module:caplin/grid/SyntheticGridDataProvider

Constructor

new module:caplin/grid/SyntheticGridDataProvider()

Constructs a caplin.grid.SyntheticGridDataProvider. A SyntheticGridDataProvider defines a provider for grids that generates a simple increments each cells content every second.

This class is an example implementation of a GridDataProvider that takes the column definitions and rows from the grid definition. These are used to define the row names and updated all other cells by one every second.

Implements:

Methods

addDataProviderListener(oDataProviderListener)

Adds a GridDataProviderListener to wishes to listen to data updates.
Parameters:
Name Type Description
oDataProviderListener module:caplin/grid/GridDataProviderListener The listener to add.
Implements:
See:

configureDataProvider(eXmlConfigurationNode)

Allow the data provider to configure itself based on the XML attributes from the node used to configure the data provider.
Parameters:
Name Type Description
eXmlConfigurationNode Element Access to the XML node that contains the row names that will be displayed within the first column of the grid.
Implements:

getSortRule()

Get the rule, if one exists, that is used to sort the data within the row model, since we do not use sorting this will always return null
Implements:

removeDataProviderListener(oDataProviderListener)

Removes a GridDataProviderListener that no longer wishes to listen to data updates.
Parameters:
Name Type Description
oDataProviderListener module:caplin/grid/GridDataProviderListener The listener to remove.
Implements:
See:

setRequiredFields(pFieldNames)

Sets the required fields that this data provider should provide within each record.
Parameters:
Name Type Description
pFieldNames Array A list of field names as strings, these are the column names provided within the gridDefinition
Implements:

setRowRange(nStartIndex, nSize)

Sets the start index and total number of rows that this SyntheticGridDataProvider should use when notifying listeners of row updates.
Parameters:
Name Type Description
nStartIndex int The start index of the first row within the range.
nSize int The number of rows within the range, which isn't used in this example
Implements: