Class: ArrayTableDataSource

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

E54107-01

QuickNav

oj. ArrayTableDataSource

Object representing data used by table component

Constructor

new ArrayTableDataSource(data, options)

Parameters:
Name Type Description
data Array | Object | function():Array data supported by the components
options Object | null Array of options for the TableDataSource
Source:

Methods

#add(m, options)

Add an instance of oj.Row 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>
silent: if set, do not fire an add event

at: splice the new Row into the RowSet at the value given (at:index)

Source:
Throws:
Type
Error

#at(index) → {Object}

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

#fetch(options)

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

Source:
Throws:
Type
Error

#get(id) → {Object}

Return the first oj.Row object from the RowSet whose Row id value is the given id
Parameters:
Name Type Description
id string ID for which to return the Row object, if found.
Source:
Throws:
Type
Error
Returns:
First Row object in the RowSet where Row.id = 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(row) → {number}

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

#Init()

Initializes the instance.
Source:

#remove(m, options)

Remove a Row from the RowSet, if found.
Parameters:
Name Type Argument Description
m Object oj.Row object or array of Rows to remove.
options Object <optional>
silent: if set, do not fire a remove event
Source:
Throws:
Type
Error

#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 or attribute/value pair objects with which to replace the RowSet's data.
options Object <optional>
user options, passed to event
Source:
Throws:
Type
Error

#size() → {number}

Get the length of the RowSet. limit it.
Source:
Returns:
length of the RowSet
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:

#totalSize() → {number}

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