new module:ct-grid /Synthetic Grid Data Provider()
Constructs a 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
add Data Provider Listener(oData Provider Listener)
Adds a GridDataProviderListener
to wishes to listen to data updates.
Parameters:
Name | Type | Description |
---|---|---|
oDataProviderListener |
module:ct-grid |
The listener to add. |
- Implements:
- See:
configure Data Provider(eXml Configuration Node)
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. |
get Sort Rule()
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:
remove Data Provider Listener(oData Provider Listener)
Removes a GridDataProviderListener
that no longer wishes to listen to data updates.
Parameters:
Name | Type | Description |
---|---|---|
oDataProviderListener |
module:ct-grid |
The listener to remove. |
- Implements:
- See:
set Required Fields(pField Names)
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 |
set Row Range(nStart Index, 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: