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:
- ojtable/ArrayTableDataSource.js, line 10
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:
- ojtable/ArrayTableDataSource.js, line 68
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:
- ojtable/ArrayTableDataSource.js, line 84
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:
- ojtable/ArrayTableDataSource.js, line 98
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:
- ojtable/ArrayTableDataSource.js, line 132
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:
- ojtable/ArrayTableDataSource.js, line 144
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:
- ojtable/ArrayTableDataSource.js, line 157
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:
- ojtable/ArrayTableDataSource.js, line 176
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:
- ojtable/ArrayTableDataSource.js, line 52
-
#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:
- ojtable/ArrayTableDataSource.js, line 191
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:
- ojtable/ArrayTableDataSource.js, line 206
Throws:
- Type
- Error
-
#size() → {number}
-
Get the length of the RowSet. limit it.
- Source:
- ojtable/ArrayTableDataSource.js, line 220
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:
- ojtable/ArrayTableDataSource.js, line 235
-
#totalSize() → {number}
-
Return the total size of data available, including server side if not local.
- Source:
- ojtable/ArrayTableDataSource.js, line 287
Returns:
total size of data- Type
- number