Caplin Trader 4.7.1

Interface: module:caplin/grid/GridRowModelListener

module:caplin/grid/GridRowModelListener

GridRowModelListener defines an interface for classes that wish to listen to GridRowModel events.

Methods

onAllDataReceived()

This callback is invoked when data has been received for all requested rows
Implementations:
  • module:caplin/grid/decorator/ColumnReorderingDecorator#onAllDataReceived
  • module:caplin/grid/decorator/LoadingDataDecorator#onAllDataReceived
  • module:caplin/grid/decorator/RemoveRowDecorator#onAllDataReceived
  • module:caplin/grid/decorator/RowLoadingDecorator#onAllDataReceived
  • module:caplin/grid/GridView#onAllDataReceived

onRowContentsChanged(indices, updates)

This call-back is invoked when the content for one or more rows change.

While the updates attribute contains only those fields that have changed since the last update, you can instead use the module:caplin/grid/GridRowModel#getRowData method if you need to retrieve the complete list of name/value pairs for any given row.

Parameters:
Name Type Description
indices Array The list of row indices for which the content has changed.
updates Array.<Object> A list of name/value pair maps (one for each row index) that contains the field updates for this row.
Implementations:

onRowDataReceived()

This callback is invoked once a response is received for the requested data.
Implementations:

onRowDataRequested()

This callback is invoked when a request for data has been initiated.
Implementations:

onRowDataUnavailable(sReason)

This callback is invoked when the request for data failed, for example due to an issue retrieving data from the server.

If the request was successful, but did not return any rows, then the module:caplin/grid/GridRowModelListener#onRowDataReceived method will be invoked followed by module:caplin/grid/GridRowModelListener#onSizeChanged with a new size of 0.

Parameters:
Name Type Description
sReason String A brief description of what the error is. The enumeration module:caplin/grid/RowDataUnavailable provides a list of the possible values.
Implementations:

onRowModelStateChanged()

This callback is invoked when the state of the row model has changed such that it is now fundamentally different to its initial configured state. A GUI could listen to this event to determine when to show an indication that the grid has changed and needs to be saved for the change to be persisted between sessions.
Implementations:
  • module:caplin/grid/GridRowSelectionModel#onRowModelStateChanged

onRowStructureChanged(indices)

This call-back is invoked when the subject-identifiers for one or more rows change.

Whereas module:caplin/grid/GridRowModelListener#onRowContentsChanged is used to denote content change within pre-existing subjects, this method signifies that there are data changes, but that they are not updates, but completely new replacement data corresponding to new subjects. The module:caplin/grid/GridRowModel#getSubjectId method can be used to get the subject identifier corresponding to a particular row.

Parameters:
Name Type Description
indices Array The list of row indices for which the subject has changed.
Implementations:

onSizeChanged(nNewSize, nOldSize)

This call-back is invoked when the total number of rows available changes — this is not the number being displayed.
Parameters:
Name Type Description
nNewSize int The new number of rows contained within the grid.
nOldSize int The old number of rows that were contained within the grid. This will be undefined the first time this method is called.
Implementations:

onStartIndexChanged(nNewStartIndex)

Callback that occurs when the total number of available rows is updated to be smaller than the maximum index currently displayed.
Parameters:
Name Type Description
nNewStartIndex int The new start index.
Implementations: