Constructor
new FlattenedTreeTableDataSource(data, options)
Parameters:
Name | Type | Description |
---|---|---|
data |
Object | |
options |
Object | null | Array of options for the TreeTableDataSource |
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. - 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
-
#collapse(rowKey)
-
Collapse the specified row.
Parameters:
Name Type Description rowKey
Object the key of the row to collapse - Source:
-
#expand(rowKey)
-
Expand the specified row.
Parameters:
Name Type Description rowKey
Object the key of the row to expand - Source:
-
#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. - 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 FlattenedTreeTableDataSource 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
-
#getWrappedDataSource() → {Object}
-
Retrieves the underlying DataSource.
- Source:
Returns:
the underlying oj.DataSource.- Type
- Object
-
#Init()
-
Initializes the instance.
- Source:
-
#off(eventType, eventHandler)
-
Detach an event handler from the datasource
Parameters:
Name Type Description eventType
string eventType supported by the datasource eventHandler
function(Object) event handler function - Source:
-
#on(eventType, eventHandler)
-
Attach an event handler to the datasource
Parameters:
Name Type Description eventType
string eventType supported by the datasource eventHandler
function(Object) event handler function - Source:
-
#sort(criteria) → {Promise}
-
Performs a sort on the data source.
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