Class: ArrayRowSet

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

E54107-01

QuickNav

oj. ArrayRowSet

RowSet of Row objects

Constructor

new ArrayRowSet(rows, options)

Parameters:
Name Type Argument Description
rows Array <optional>
Set of row objects or JS array of data to put into rowSet at construction time
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

_addToRowSet(m, index, options)

Parameters:
Name Type Argument Description
m Object Row instance or array of Rows or sets of attribute/values
index number Index value
options Object <optional>
silent: if set, do not fire an add event
Source:

add(m, options) → {Object}

Add an instance of this RowSet's Row(s) to the end of the RowSet.
Parameters:
Name Type Argument Description
m Object Row object (or array of rows) to add. These can be already-created instance of the oj.Row object, or sets of attribute/values, which will be wrapped by add().
options Object <optional>
at: splice the new Row into the RowSet at the value given (at:index)

deferred: if true, return a promise as though this RowSet were virtual whether it is or not silent: if set, do not fire an add event

Source:
Returns:
if deferred or virtual, return a promise when the set has completed
Type
Object

at(index, options) → {Object}

Return the Row object found at the given index of the RowSet, 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 RowSet is virtual

Source:
Returns:
Row object located at index. If index is out of range, returns null. If this is a paging/virtual RowSet 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

clone() → {Object}

Source:
Returns:
copy of the RowSet
Type
Object

get(id, options) → {Object}

Return the first Row object from the RowSet 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 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 RowSet were virtual whether it is or not

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

hasMore() → {boolean}

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 RowSet 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}

Source:
Returns:
true if RowSet is empty
Type
boolean

remove(row, options)

Remove a Row from the RowSet, if found.
Parameters:
Name Type Argument Description
row Object Row object
options Object <optional>
silent: if set, do not fire a remove event
Source:

reset(data, options)

Remove and replace the RowSet's entire list of Rows with a new set of Rows, if provided. Otherwise, empty the RowSet.
Parameters:
Name Type Argument Description
data Object <optional>
Array of Row objects with which to replace the RowSet's data.
options Object <optional>
user options, passed to event
Source:

size() → {number}

Source:
Returns:
length of the RowSet
Type
number

sort()

Source:

totalSize() → {number}

Source:
Returns:
length of the RowSet
Type
number