Constructor
new TableDataSource(data, options)
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
data |
Object | data supported by the components | |
options |
Object |
<optional> |
Options for the TableDataSource |
- Source:
Fields
-
<static> EventType :string
-
- Source:
Properties:
Name Type Default Description ADD
string add Triggered when a Row is added to a TableDataSource The event payload contains:
data An array of raw row data keys An array of key values for the rows indexes An array of index values for the rows in post-insert sorted order REMOVE
string remove Triggered when a Row is removed from a TableDataSource The event payload contains:
data An array of raw row data keys An array of key values for the rows indexes An array of index values for the rows in pre-remove sorted order RESET
string reset Triggered when a TableDataSource is reset REFRESH
string refresh Triggered when a TableDataSource is refreshed SORT
string sort Triggered when a TableDataSource is sorted The event payload contains:
header the key of the header which was sorted on direction the direction of the sort ascending/descending CHANGE
string change Triggered when a Row's attributes are changed The event payload contains:
data An array of raw row data keys An array of key values for the rows indexes An array of index values for the rows REQUEST
string request Triggered when a TableDataSource has sent a fetch request The event payload contains: startIndex The start index at which the fetch was invoked SYNC
string sync Triggered when a TableDataSource has been updated by a fetch The event payload contains:
data An array of raw row data keys An array of key values for the rows startIndex The start index at which the fetch occurred ERROR
string error Triggered when an error occurred on the TableDataSource
Methods
-
#at(index, options) → {Promise}
-
Return the row data found at the given index.
Parameters:
Name Type Argument Description index
number Index for which to return the row data. options
Object <optional>
Options to control the at. Properties
Name Type Description fetchSize
number fetch size to use if the call needs to fetch more records from the server, if virtualized. Overrides the overall fetchSize setting - Source:
Returns:
Promise resolves to a compound object which has the structure below. If the index is out of range, Promise resolves to null.data The raw row data index The index for the row key The key value for the row - Type
- Promise
-
#fetch(options) → {Promise}
-
Fetch the row data.
Parameters:
Name Type Argument Description options
Object <optional>
Options to control fetch Properties
Name Type Description startIndex
number The index at which to start fetching records. silent
boolean If set, do not fire a sync event. - Source:
Returns:
Promise object resolves to a compound object which contains an array of row data objects, an array of ids, and the startIndex triggering done when complete.The structure of the resolved compound object is:
data An array of raw row data keys An array of key values for the rows startIndex The startIndex for the returned set of rows - Type
- Promise
-
#get(id, options) → {Promise}
-
Return the first row data whose id value is the given id
Parameters:
Name Type Argument Description id
string ID for which to return the row data, if found. options
Object <optional>
Options to control the get. Properties
Name Type Description fetchSize
number fetch size to use if the call needs to fetch more records from the server, if virtualized. Overrides the overall fetchSize setting - Source:
Returns:
Promise which resolves to a compound object which has the structure below where the id matches the given id. If none are found, resolves to null.data The raw row data index The index for the row key The key value for the row - Type
- Promise
-
#getCapability(feature) → {string|null}
-
Determines whether this TableDataSource supports certain feature.
Parameters:
Name Type Description feature
string the feature in which its capabilities is inquired. Currently the only valid feature is "sort". - Source:
Returns:
the name of the feature. For "sort", the valid return values are: "full", "none". Returns null if the feature is not recognized.- Type
- string | null
-
#Init()
-
Initializes the instance.
- Source:
-
#sort(criteria) → {Promise}
-
Performs a sort on the data source. Null criteria clears the existing sort.
Parameters:
Name Type Description criteria
Object the sort criteria. Properties
Name Type Description key
Object The key that identifies which field to sort direction
string the sort direction, valid values are "ascending", "descending", "none" (default) - Source:
Returns:
promise object triggering done when complete.- Type
- Promise
-
#totalSize() → {number}
-
Return the total size of data available, including server side if not local.
- Source:
Returns:
total size of data- Type
- number
-
#totalSizeConfidence() → {string}
-
Returns the confidence for the totalSize value.
- Source:
Returns:
"actual" if the totalSize is the time of the fetch is an exact number "estimate" if the totalSize is an estimate "atLeast" if the totalSize is at least a certain number "unknown" if the totalSize is unknown- Type
- string