Class: PagingTableDataSource

Oracle® Fusion Middleware Oracle JavaScript Extension Toolkit (JET)
12c (12.1.4)

E54107-01

QuickNav

oj. PagingTableDataSource

Object representing data used by the paging component

Constructor

new PagingTableDataSource(dataSource, options)

Parameters:
Name Type Description
dataSource Object
options Object | null Array of options for the PagingControlDataSource
Source:

Methods

#at(index) → {Object}

Return the model object found at the given index of the collection.
Parameters:
Name Type Description
index number Index for which to return the model object.
Source:
Throws:
Type
Error
Returns:
Model object located at index. If index is out of range, returns null.
Type
Object

#fetch(options)

Calls fetch on the datasource with paging options.
Parameters:
Name Type Argument Description
options Object <optional>
Options to control fetch

startIndex: The index at which to start fetching records.

pageSize: The number of records to be fetched.

Source:
Throws:
Type
Error

#get(id) → {Object}

Return the first model object from the collection whose model id value is the given id or cid, or the id or cid from a passed in model
Parameters:
Name Type Description
id Object | string ID, cid, or Model (see Model id or cid) for which to return the model object, if found.
Source:
Throws:
Type
Error
Returns:
First model object in the collection where model.id = id or model.cid = id. If none are found, returns null.
Type
Object

#getCapability(feature) → {string|null}

Determines whether this TableDataSource 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

#hasMore() → {boolean}

Return whether there is more data which can be fetched.
Source:
Returns:
whether there is more data
Type
boolean

#indexOf(model) → {number}

Return the array index location of the given model object.
Parameters:
Name Type Description
model Object Model object to locate
Source:
Throws:
Type
Error
Returns:
The index of the given model object. If the object is not found, returns -1.
Type
number

#Init()

Initializes the instance.
Source:

#next()

Calls fetch for the next page of data. No-op if no more data.
Source:
Throws:
Type
Error

#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
Source:

#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
Source:

#previous()

Calls fetch for the previous page of data. No-op if at the beginning.
Source:
Throws:
Type
Error

#setPageSize(n)

Set or change the number of models in a page
Parameters:
Name Type Description
n number page size
Source:

#size() → {number}

Return the size of the data locally in the dataSource. -1 if an initial fetch has not been done yet.
Source:
Returns:
size of data
Type
number

#sort(criteria)

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

#startIndex() → {number}

Return current start index. -1 if initial fetch has not been done yet.
Source:
Returns:
start index
Type
number

#totalSize() → {number}

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