Final Class: FlattenedTreeTableDataSource

Oracle® JavaScript Extension Toolkit (JET)
16.1.0

F92237-01

Since:
  • 1.0
Module:
  • ojflattenedtreetabledatasource

Note: This class is deprecated since 14.0.0. FlattenedTreeTableDataSource has been deprecated, use FlattenedTreeDataProviderView instead.

QuickNav

Fields

Description

Object representing data used by Table with RowExpander.

See the Row Expander - Table demo for an example.

Refer to TableDataSource for other data sources that represent tabular data.


Usage

For additional information visit:


Final classes in JET

Classes in JET are generally final and do not support subclassing. At the moment, final is not enforced. However, this will likely change in an upcoming JET release.


Constructor

new FlattenedTreeTableDataSource(data, options)

Parameters:
Name Type Description
data Object
options Object | null Options for the FlattenedTreeTableDataSource
Properties
Name Type Description
startFetch string Control whether to start initial fetch when the TableDataSource is bound to a component. Valid values are:

"enabled" (default) - Start initial fetch automatically when the TableDataSource is bound to a component.
"disabled" - Do not start initial fetch automatically. Application will call the fetch() method to start the first fetch.

Fields

sortCriteria :Object

The sort criteria. Whenever sort() is called with the criteria parameter, that value is copied to this property. If sort() is called with empty sort criteria then the criteria set in this property is used.
Properties:
Name Type Description
criteria.direction 'ascending' | 'descending' | 'none' the sort direction, valid values are "ascending", "descending", "none" (default)
criteria.key any The key that identifies which field to sort
Inherited From:

Methods

_getMetadata

* end delegated functions

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.
Returns:

Promise resolves to a compound object which has the structure below. If the index is out of range, Promise resolves to null.

dataThe raw row data
indexThe index for the row
keyThe 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

expand(rowKey)

Expand the specified row.
Parameters:
Name Type Description
rowKey Object the key of the row to expand

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.
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:

dataAn array of raw row data
keysAn array of key values for the rows
startIndexThe 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.
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.

dataThe raw row data
indexThe index for the row
keyThe 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".
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.
Returns:

the underlying DataSource.

Type
Object

handleEvent(eventType, event) : {boolean}

Handle the event
Parameters:
Name Type Description
eventType string event type
event Object event
Inherited From:
Returns:

Returns false if event is cancelled

Type
boolean

Init : {undefined}

Initializes the instance.
Inherited From:
Returns:
Type
undefined

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

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

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)
Returns:

promise object triggering done when complete.

Type
Promise

totalSize : {number}

Return the total size of data available, including server side if not local.
Returns:

total size of data

Type
number

totalSizeConfidence : {string}

Returns the confidence for the totalSize value.
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