Class: CollectionPagingDataSource

Oracle® JavaScript Extension Toolkit (JET)
3.2.0

E87541-01

QuickNav

oj. CollectionPagingDataSource extends oj.DataSource

Version:
  • 3.2.0
Implementation of PagingModel using an oj.Collection

Constructor

new CollectionPagingDataSource(collection)

Implementation of PagingModel backed by an oj.Collection. CollectionPagingDataSource provides a window into the collection, presenting both a standard JavaScript array and Knockout observable array for consumption. It is designed to feed a Knockout-bound HTML control, for example.
Parameters:
Name Type Description
collection oj.Collection the collection to use as source data for this paging control
Source:

Methods

_setPageSize(n)

Set or change the number of models in a page
Parameters:
Name Type Description
n number page size
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 and the startIndex triggering done when complete.

The structure of the resolved compound object is:

dataAn array of raw row data
startIndexThe startIndex for the returned set of rows
Type
Promise

#getCapability(feature) → {string|null}

Determines whether this data source 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

#getEndItemIndex() → {number}

Get the current page end index
Source:
Returns:
The current page end index
Type
number

#getPage() → {number}

Get the current page
Source:
Returns:
The current page
Type
number

#getPageCount() → {number}

Get the page count
Source:
Returns:
The total number of pages
Type
number

#getStartItemIndex() → {number}

Get the current page start index
Source:
Returns:
The current page start index
Type
number

getWindow() → {Array}

Source:
Returns:
the current set of data in the paging window
Type
Array

getWindowObservable() → {Object}

Source:
Returns:
an observable array representing the current data in the paging window
Type
Object

Init()

Initializes the instance.
Source:

off(eventType, eventHandler)

Detach an event handler
Parameters:
Name Type Description
eventType string eventType
eventHandler function(Object) event handler function
Inherited From:
Source:

on(eventType, eventHandler)

Attach an event handler
Parameters:
Name Type Description
eventType string eventType
eventHandler function(Object) event handler function
Inherited From:
Source:

#setPage(value, options) → {Promise}

Set the current page
Parameters:
Name Type Argument Description
value number The current page
options Object <optional>
Options

pageSize: The page size.

Source:
Returns:
promise object triggering done when complete..
Type
Promise

#size() → {number}

Source:
Returns:
size of data
Type
number

#totalSize() → {number}

Source:
Returns:
total size of data
Type
number

#totalSizeConfidence() → {string}

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