Methods
on All Data Received()
This callback is invoked when data has been received for all requested rows
on Row Contents Changed(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:ct-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 |
A list of name/value pair maps (one for each row index) that contains the field updates for this row. |
on Row Data Received()
This callback is invoked once a response is received for the requested data.
on Row Data Requested()
This callback is invoked when a request for data has been initiated.
on Row Data Unavailable(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:ct-grid/GridRowModelListener#onRowDataReceived
method will be invoked followed by module:ct-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
|
on Row Model State Changed()
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.
on Row Structure Changed(indices)
This call-back is invoked when the subject-identifiers for one or more rows change.
Whereas module:ct-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:ct-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. |
on Size Changed(nNew Size, nOld Size)
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
|
on Start Index Changed(nNew Start Index)
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. |