Usage
Signature:
interface FetchListResult<K, D>
Generic Parameters
Parameter Description K Type of Key D Type 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
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
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 }