Constructor
new FlattenedTreeDataProviderView(dataProvider, options)
Parameters:
| Name | Type | Argument | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
dataProvider |
TreeDataProvider<K, D> | the wrapped TreeDataProvider to flatten. | |||||||||
options |
Object |
<optional> |
Properties
|
Methods
-
addEventListener(eventType: string, listener: EventListener): void
-
-
containsKeys(params: FetchByKeysParameters<K>): Promise<ContainsKeysResults<K>>
-
Check if there are rows containing the specified keys
Parameters:
Name Type Description paramsoj.FetchByKeysParameters Fetch by keys parameters - Since:
- 6.2.0
Returns:
Promise which resolves to oj.ContainsKeysResults- Type
- Promise.<oj.ContainsKeysResults>
-
dispatchEvent(evt: Event): boolean
-
-
fetchByKeys(params: FetchByKeysParameters<K>): Promise<FetchByKeysResults<K, D>>
-
Fetch rows by keys
Parameters:
Name Type Description paramsoj.FetchByKeysParameters Fetch by keys parameters - Since:
- 6.2.0
Returns:
Promise which resolves to oj.FetchByKeysResults- Type
- Promise.<oj.FetchByKeysResults>
-
fetchByOffset(params: FetchByOffsetParameters<D>): Promise<FetchByOffsetResults<K, D>>
-
Fetch rows by offset
Parameters:
Name Type Description paramsoj.FetchByOffsetParameters Fetch by offset parameters - Since:
- 4.2.0
Returns:
Promise which resolves to oj.FetchByOffsetResults- Type
- Promise.<oj.FetchByOffsetResults>
-
fetchFirst(params?: FetchListParameters<D>): AsyncIterable<FetchListResult<K, D>>
-
Fetch the first block of data.
Parameters:
Name Type Argument Description paramsoj.FetchListParameters <optional>
Fetch parameters - Since:
- 6.2.0
- See:
-
- https://github.com/tc39/proposal-async-iteration for further information on AsyncIterable.
Returns:
AsyncIterable with oj.FetchListResult- Type
- AsyncIterable.<oj.FetchListResult>
-
getCapability(capabilityName: string): any
-
Determines whether this DataProvider supports certain feature.
Parameters:
Name Type Description capabilityNamestring capability name. Supported capability names are determined by the underlying dataprovider. - Since:
- 6.2.0
Returns:
capability information or null if unsupported- Type
- Object
-
getExpandedObservable():{ subscribe( subscriber : ((expanded: {value: KeySet<K>, completionPromise: Promise<any>}) => void) ): {unsubscribe(): void, closed(): boolean}}
-
Get the observable with information about the expanded state to subscribe to. Consumers can call subscribe and unsubscribe to receive changes to the expanded property.
On the first subscribe call, the initial value will be passed to the subscriber.
The observed value is an object with the following properties: value: KeySet - new expanded key set completionPromise?: Promise - resolved after all mutations have fired relevant to the expand/collapse. Example of consumer listening for the "mutate" event type:
expandedObserexpandedObservable = dataprovider.getExpandedObservable(); subscriber = expandedObservable.subscribe(function(detail){ expanded = detail.value; promise = detail.completionPromise; // handle changes }); // unsubscribe later subscriber.unsubscribe();- See:
-
- https://github.com/tc39/proposal-observable for further information on Observable and Subscription.
Returns:
an object to call subscribe on to receive changes to the expanded property. The subscribe function returns an object to call unsubscribe on.- Type
- Object
-
getTotalSize() : {Promise.<number>}
-
Return the total number of rows in this dataprovider. Will return -1 if count cannot be determined.
Returns:
Returns a Promise which resolves to the total number of rows. -1 is unknown row count.- Type
- Promise.<number>
-
isEmpty() : {"yes"|"no"|"unknown"}
-
Return a string that indicates if this data provider is empty
Returns:
a string that indicates if this data provider is empty. Valid values are: "yes": this data provider is empty. "no": this data provider is not empty. "unknown": it is not known if this data provider is empty until a fetch is made.- Type
- "yes" | "no" | "unknown"
-
removeEventListener(eventType: string, listener: EventListener): void
-
-
setExpanded(keySet: KeySet<K>): void
-
Set a new expanded property on the FlattenedTreeDataProviderView.
Parameters:
Name Type Description keySetKeySet the new key set representing expanded