Constructor
new module:ct-grid /Data Provider Row Model(column Model, data Provider)
Constructs a DataProviderRowModel
.
Parameters:
Name | Type | Description |
---|---|---|
columnModel |
module:ct-grid |
The column model this row model is associated with — necessary for listening to sorting and filtering events on the column model. |
dataProvider |
module:ct-grid |
The data provider instance that will do the actual work of providing the data that will be contained by the row model. |
Members
(static, readonly) OBJECT _DATA _TIMEOUT :int
The amount of time to wait for each object before firing module:ct-grid/GridRowModelListener#onAllDataReceived
Type:
- int
Methods
add Row(sSubject)
Adds a row to the GridRowModel
.
Parameters:
Name | Type | Description |
---|---|---|
sSubject |
String | The RTTP subject identifier (e.g. /FX/EURUSD) for the new row. |
- Implements:
add Row Model Listener(oRow Model Listener)
Adds a listener to the row model, to be communicated of all row model events.
Parameters:
Name | Type | Description |
---|---|---|
oRowModelListener |
module:ct-grid |
The listener to add. |
- Implements:
- See:
can Receive()
- Implements:
- See:
can Receive Multiple Objects()
- Implements:
- See:
can Receive Objects()
- Implements:
- See:
clear Filter Expression(sFilter Nameopt)
Removes the named filter expression from the row model.
The filter name parameter is optional. If no parameter is passed then the 'default' parameter expression will be removed.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
sFilterName |
String |
<optional> |
The name of the filter expression to remove. |
clear Group ByField()
Removes any grouping from the grid row model.
- Implements:
clear Sort Rule()
Removes any sorting from the grid row model.
- Implements:
get All Filter Expressions()
Returns a map of all filter expressions.
The returned map should not be modified by external clients as it is may be used internally by the row model class.
get Filter Expression(sFilter Nameopt) → {module:ct-grid /filter /Filter Expression}
Returns the named filter expression.
The filter name parameter is optional. If no parameter is passed then the 'default' parameter expression will be returned.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
sFilterName |
String |
<optional> |
The name of the filter expression to remove. |
- Implements:
Returns:
the filter with the specified name.
get Group ByField() → {String}
Get the field, if one has been set, that is used to group the rows contained within row model.
- Implements:
Returns:
a String, if one exists, or null
otherwise.
- Type
- String
get Index BySubject(sSubject)
Return the index of a subject.
Parameters:
Name | Type | Description |
---|---|---|
sSubject |
String | The RTTP subject identifier (e.g. /FX/EURUSD) for the row. |
- Implements:
get Last Receive Failure Message()
- Implements:
- See:
get Permission Key() → {module:ct-services /security /Permission Key}
Returns a tuple containing the permissioning search query parameters that can be used to determine whether the user has the available permissions to view the data contained within this row model.
Row models whose data is not permissioned do not need to return a permissioning key, and may instead
return null
.
- Implements:
- See:
Returns:
the permissioning key tuple, or null
get Row Data(nIndex) → {Object}
Returns the row data record at the specified index.
Parameters:
Name | Type | Description |
---|---|---|
nIndex |
int | The index of the specified row. |
- Implements:
Returns:
the row data for the specified index.
- Type
- Object
get Row Range Size()
Returns the size of the row range that is set with the setRowRange method.
- Implements:
get Serialized State() → {String}
Invoked when the grid is saved.
- Implements:
Returns:
An XML representation of the current state of this GridRowModel
. This may
be an empty string if the row model was configured by a parent grid definition.
- Type
- String
get Size() → {int}
Returns the number of rows available — not the number of rows that are currently visible.
- Implements:
Returns:
The number of rows available
- Type
- int
get Sort Rule() → {module:ct-grid /sort /Sort Rule}
Get the rule, if one exists, that is used to sort the data within the row model.
- Implements:
Returns:
a SortRule
, if one
exists, or null
otherwise.
get Start Index() → {int}
Returns the start index of the row model which can be used to see how many rows have been scrolled.
- Implements:
Returns:
The start index
- Type
- int
get Subject Id(nIndex) → {String}
Returns the RTTP subject identifier for the row at the specified index.
Row models whose rows correspond to objects that can be requested from a Liberator should use this method to make that information available — this may be true even for row models where the data itself does not come from a Liberator (e.g. a custom web-service) provided the row data corresponds to requestable objects within the Liberator.
Some decorators (such as the module:ct-grid/decorator/DragDecorator
require this information
in order to allow dragging & dropping of row data into trade panels or custom grids. Row models whose data
does not correspond to requestable objects within the Liberator can instead return null
.
Parameters:
Name | Type | Description |
---|---|---|
nIndex |
int | The index of the row being queried. |
- Implements:
Returns:
the RTTP subject identifier (e.g. /FX/EURUSD) for the given row, or null
otherwise.
- Type
- String
get Subjects()
- Implements:
- Deprecated:
- Yes
get Success Message()
get Transform Mode() → {String}
Get the transform mode that determines how grid updates are pushed out from the data source.
- Implements:
Returns:
The transform mode - either 'snapshot' or 'live'
- Type
- String
get Visible Subjects() → {Array}
Returns an array of subjects currently in the model (corresponding to visible rows), in order.
- Implements:
Returns:
the visible subject
- Type
- Array
pause Updates()
Signals the GridRowModel
to temporarily pause any updates to all RowModelListener
instances.
receive Objects()
- Implements:
- See:
remove Row(sSubject)
Removes a row from the GridRowModel
.
Parameters:
Name | Type | Description |
---|---|---|
sSubject |
String | The RTTP subject identifier (e.g. /FX/EURUSD) for the new row. |
- Implements:
remove Row Model Listener(oRow Model Listener)
Removes a listener that no longer wishes to listen to row model events.
Parameters:
Name | Type | Description |
---|---|---|
oRowModelListener |
module:ct-grid |
The listener to remove. |
- Implements:
- See:
remove Rows(pSubjects)
Removes a number of rows from the GridRowModel
.
Parameters:
Name | Type | Description |
---|---|---|
pSubjects |
String | The RTTP subject identifiers of the rows to remove. |
- Implements:
resume Updates()
Signals the GridRowModel
to resume updates to any RowModelListener
instances.
set Filter Expression(oFilter Expression, sFilter Nameopt)
Add a filter expression to this row model.
The filter name parameter is optional. If no parameter is passed then this filter expression will be assumed to be 'default'.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
oFilterExpression |
module:ct-grid |
The filter expression to apply to this row model. |
|
sFilterName |
String |
<optional> |
The name that this filter expression will be known by. |
- Implements:
set Group ByField(sField Name)
Sets the field to be used for grouping the rows within the row model.
Parameters:
Name | Type | Description |
---|---|---|
sFieldName |
String | The field name that will be used for grouping. |
- Implements:
set Row Data(nIndex, mRow Data)
Method added to allow editing data inside grid.
Sets the field value for the row with the specific index
Parameters:
Name | Type | Description |
---|---|---|
nIndex |
String | index id of the row to add field |
mRowData |
Map | field maps to update |
- Implements:
set Row Data BySubject(index, row Data)
Method added to allow editing data inside grid. The implementation adds the field to a field cache which overrides the fields received from rttp Sets the field value for the row with the specific index
Parameters:
Name | Type | Description |
---|---|---|
index |
int | index id of the row to add field |
rowData |
Map | field maps to update |
set Row Range(nStart Index, nSize)
Sets the start index and total number of rows that the module:ct-grid/GridView
is able to
display, and hence the the row model should provide.
Parameters:
Name | Type | Description |
---|---|---|
nStartIndex |
int | The start index of the first row visible within the view. |
nSize |
int | The number of rows visible within the view. |
- Implements:
set Sort Rule(oSort Rule)
Set a rule that will be used to sort the data within the row model.
Parameters:
Name | Type | Description |
---|---|---|
oSortRule |
module:ct-grid |
The object containing the sort parameters. |
- Implements:
supports Feature(feature)
Determine whether this instance of GridRowModel
supports a particular feature.
This method is merely proxied on to the underlying module:ct-grid/GridDataProvider
.
Parameters:
Name | Type | Description |
---|---|---|
feature |
int | the feature constant that is being queried. |
- Implements:
- See:
terminate Updates()
Signals the GridRowModel
to terminate all updates to any RowModelListener
instances.
This method is essentially the destructor for classes implementing GridRowModel
, and
is the opportunity to perform any clean-up that may be required.
- Implements: