Class: CollectionRowSet

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

E54107-01

QuickNav

oj. CollectionRowSet

RowSet wrapper for oj.Collection

Constructor

new CollectionRowSet(collection, options)

Parameters:
Name Type Argument Description
collection oj.Collection oj.Collection object
options Object <optional>
Passed through to the user's initialize routine, if any, upon construction
Source:

Fields

comparator :String|function(Object)|function(Object,Object)

If set, sort the rowSet using the given attribute of a row (if string); function(Row) returning a string attribute by which the sort should take place; function(Row1, Row2) if a user-defined function comparing Row1 and Row2 (see the JavaScript array.sort() for details)
Source:

sortSupported :boolean

Set to true if sort is supported.
Source:

Methods

#at(index, options) → {Object}

Return the row object found at the given index of the collection, or a promise object that will return the row to a function in the done() call.
Parameters:
Name Type Argument Description
index number Index for which to return the row object.
options Object <optional>

fetchSize: fetch size to use if the call needs to fetch more records from the server, if virtualized. Overrides the overall fetchSize setting

deferred: if true, return a deferred/promise object as described below. If not specified, the return value will be determined by whether or not the collection is virtual

Source:
Returns:
Row object located at index. If index is out of range, returns null. If this is a paging/virtual collection or if deferred is specified and true, at will return a jQuery promise object which will call its done function, passing the value at(index)
Type
Object

#fetch(options)

Loads the data into the RowSet
Parameters:
Name Type Argument Description
options Object <optional>
Options to control fetch

Source:
Throws:
Type
Error

#get(id, options) → {Object}

Return the first row object from the collection whose row id value is the given id Note this method will not function as expected if the id is not set
Parameters:
Name Type Argument Description
id Object | string ID for which to return the row object, if found.
options Object <optional>

fetchSize: fetch size to use if the call needs to fetch more records from the server, if virtualized. Overrides the overall fetchSize setting

deferred: if true, return a promise as though this collection were virtual whether it is or not

Source:
Returns:
First row object in the collection where row.id = id. If none are found, returns null. If deferred or virtual, return a promise passing the row when done
Type
Object

#getCollection() → {oj.Collection}

Return the oj.Collection object which was wrapped
Source:
Returns:
oj.Collection object
Type
oj.Collection

#hasMore() → {boolean}

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

#indexOf(row, options) → {number}

Return the array index location of the given row object.
Parameters:
Name Type Argument Description
row Object Row object to locate
options Object <optional>
deferred: if true, return a promise as though this collection were virtual whether it is or not
Source:
Returns:
The index of the given row object, or a promise that will call with the index when complete. If the object is not found, returns -1.
Type
number

#isEmpty() → {boolean}

Determine if the rowset has any rows
Source:
Returns:
true if collection is empty
Type
boolean

#size() → {number}

Return the length of the collection
Source:
Returns:
length of the collection
Type
number

#sort()

Sort the rows in the rowSet
Source:

#totalSize() → {number}

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