Constructor
new RowSet(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:
- ojdatacollection-common/RowSet.js, line 12
Fields
-
<static> _ROW_STATUSES :string
-
- Source:
- ojdatacollection-common/RowSet.js, line 282
Properties:
Name Type Default Description _ADDEDstring added _DELETEDstring deleted _UPDATEDstring updated _NONEstring none -
<static> EventType :string
-
- Source:
- ojdatacollection-common/RowSet.js, line 251
Properties:
Name Type Default Description ADDstring add Triggered when a Row is added to a RowSet REMOVEstring remove Triggered when a Row is removed from a RowSet RESETstring reset Triggered when a RowSet is reset (see oj.RowSet.reset) SORTstring sort Triggered when a RowSet is sorted CHANGEstring change Triggered when a Row's attributes are changed DESTROYstring destroy Triggered when a Row is deleted from the data service (and thus from its RowSet) REQUESTstring request Triggered when a Row or RowSet has sent a request to the data service SYNCstring sync Triggered when a Row or RowSet has been updated from the data service ERRORstring error Triggered when a Row has failed to update on the data service INVALIDstring invalid Triggered when a Row being saved has been invalidated by the caller ALLstring all Triggered for any of the above events -
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:
- ojdatacollection-common/RowSet.js, line 26
-
sortSupported :boolean
-
Set to true if sort is supported.
- Source:
- ojdatacollection-common/RowSet.js, line 34
Methods
-
_handleEvent(eventType, event)
-
Handle the event
Parameters:
Name Type Description eventTypestring event type event? event - Source:
- ojdatacollection-common/RowSet.js, line 233
-
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 indexnumber Index for which to return the Row object. optionsObject <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:
- ojdatacollection-common/RowSet.js, line 78
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
-
#fetch(options)
-
Loads the data into the RowSet
Parameters:
Name Type Argument Description optionsObject <optional>
Options to control fetch - Source:
- ojdatacollection-common/RowSet.js, line 93
Throws:
- Type
- Error
-
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 idObject | string ID for which to return the Row object, if found. optionsObject <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:
- ojdatacollection-common/RowSet.js, line 109
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:
- ojdatacollection-common/RowSet.js, line 120
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 rowObject Row object to locate optionsObject <optional>
deferred: if true, return a promise as though this RowSet were virtual whether it is or not - Source:
- ojdatacollection-common/RowSet.js, line 135
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:
- ojdatacollection-common/RowSet.js, line 147
Returns:
true if RowSet is empty- Type
- boolean
-
off(eventType, eventHandler)
-
Detach an event handler from the datasource
Parameters:
Name Type Description eventTypestring eventType supported by the datasource eventHandlerfunction(Object) event handler function - Source:
- ojdatacollection-common/RowSet.js, line 213
-
#oj.ArrayRowSet#fetch(options)
-
Loads the data into the RowSet
Parameters:
Name Type Argument Description optionsObject <optional>
Options to control fetch - Source:
- ojdatacollection-common/ArrayRowSet.js, line 181
Throws:
- Type
- Error
-
on(eventType, eventHandler)
-
Attach an event handler to the datasource
Parameters:
Name Type Description eventTypestring eventType supported by the datasource eventHandlerfunction(Object) event handler function - Source:
- ojdatacollection-common/RowSet.js, line 190
-
size() → {number}
-
- Source:
- ojdatacollection-common/RowSet.js, line 158
Returns:
length of the RowSet- Type
- number
-
sort()
-
- Source:
- ojdatacollection-common/RowSet.js, line 168
-
totalSize() → {number}
-
- Source:
- ojdatacollection-common/RowSet.js, line 178
Returns:
length of the RowSet- Type
- number