Interface: FetchListResult

Oracle® JavaScript Extension Toolkit (JET)
17.1.0

G12196-01

Since:
  • 4.1.0
Module:
  • ojdataprovider

QuickNav

Fields

Description

Defines the results from the DataProvider method DataProvider#fetchFirst.


Usage

Signature:

interface FetchListResult<K, D>

Generic Parameters
ParameterDescription
KType of Key
DType of Data
Typescript Import Format
//To use this interface, import as below.
import {FetchListResult} from "ojs/ojdataprovider";

For additional information visit:


Fields

data :D[]

Array of data for each row
Since:
  • 4.1.0

fetchParameters :FetchListParameters.<D>

The FetchListParameters used for the fetch call. In addition, the property fetchParameters is not only the parameter passed through from fetchFirst. The sortCriteria of fetchParameters is the sort criteria specified in fetchFirst parameter, it also include the implicitSort criteria specified in data provider constructor. For example, if implicitSort is set in ArrayDataProvider constructor, it will be returned as part of the sortCriteria of fetchParameters. The collection components, such as ojTable, will look at the sortCriteria to put appropriate sort icon on the UI rendered.
Since:
  • 4.1.0
Example

Example of retrieving sortCriteria from FetchListResult:

let asyncIterator = dataprovider.fetchFirst(options)[Symbol.asyncIterator]();
let result = await asyncIterator.next();
let sortCriteria = result.value.fetchParameters.sortCriteria;

metadata :Array.<ItemMetadata.<K>>

Array of {link@ ItemMetadata} for each row
Since:
  • 4.1.0

(nullable) totalFilteredRowCount :number

Total number of rows that can be iterated after applying any filterCriterion.

This is independent of how many rows are returned in each iteration. A value of -1 indicates unknown row count.

Since:
  • 12.0.0
Example

Request and use totalFilteredRowCount

const fetchListParams = {includeFilteredRowCount: 'enabled'};
const asyncIterator = dataprovider.fetchFirst(fetchListParams)[Symbol.asyncIterator]();
let iteratorResult = await asyncIterator.next();
let fetchListResult = iteratorResult.value;
let totalFilteredRowCount = fetchListResult.totalFilteredRowCount;
if (typeof totalFilteredRowCount === 'number' && totalFilteredRowCount !== -1) {
  // Do something with totalFilteredRowCount if available
}