Constructor
new PagingTableDataSource(dataSource, options)
Parameters:
Name | Type | Description |
---|---|---|
dataSource |
Object | |
options |
Object | null | Array of options for the PagingControlDataSource |
- Source:
- ojtable/PagingTableDataSource.js, line 10
Methods
-
#at(index) → {Object}
-
Return the model object found at the given index of the collection.
Parameters:
Name Type Description index
number Index for which to return the model object. - Source:
- ojtable/PagingTableDataSource.js, line 141
Throws:
- Type
- Error
Returns:
Model object located at index. If index is out of range, returns null.- Type
- Object
-
#fetch(options)
-
Calls fetch on the datasource with paging options.
Parameters:
Name Type Argument Description options
Object <optional>
Options to control fetch startIndex: The index at which to start fetching records.
pageSize: The number of records to be fetched.
- Source:
- ojtable/PagingTableDataSource.js, line 55
Throws:
- Type
- Error
-
#get(id) → {Object}
-
Return the first model object from the collection whose model id value is the given id or cid, or the id or cid from a passed in model
Parameters:
Name Type Description id
Object | string ID, cid, or Model (see Model id or cid) for which to return the model object, if found. - Source:
- ojtable/PagingTableDataSource.js, line 156
Throws:
- Type
- Error
Returns:
First model object in the collection where model.id = id or model.cid = 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/PagingTableDataSource.js, line 171
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/PagingTableDataSource.js, line 184
Returns:
whether there is more data- Type
- boolean
-
#indexOf(model) → {number}
-
Return the array index location of the given model object.
Parameters:
Name Type Description model
Object Model object to locate - Source:
- ojtable/PagingTableDataSource.js, line 199
Throws:
- Type
- Error
Returns:
The index of the given model object. If the object is not found, returns -1.- Type
- number
-
#Init()
-
Initializes the instance.
- Source:
- ojtable/PagingTableDataSource.js, line 39
-
#next()
-
Calls fetch for the next page of data. No-op if no more data.
- Source:
- ojtable/PagingTableDataSource.js, line 73
Throws:
- Type
- Error
-
#off(eventType, eventHandler)
-
Detach an event handler from the datasource
Parameters:
Name Type Description eventType
string eventType supported by the datasource eventHandler
function(Object) event handler function - Source:
- ojtable/PagingTableDataSource.js, line 228
-
#on(eventType, eventHandler)
-
Attach an event handler to the datasource
Parameters:
Name Type Description eventType
string eventType supported by the datasource eventHandler
function(Object) event handler function - Source:
- ojtable/PagingTableDataSource.js, line 213
-
#previous()
-
Calls fetch for the previous page of data. No-op if at the beginning.
- Source:
- ojtable/PagingTableDataSource.js, line 90
Throws:
- Type
- Error
-
#setPageSize(n)
-
Set or change the number of models in a page
Parameters:
Name Type Description n
number page size - Source:
- ojtable/PagingTableDataSource.js, line 110
-
#size() → {number}
-
Return the size of the data locally in the dataSource. -1 if an initial fetch has not been done yet.
- Source:
- ojtable/PagingTableDataSource.js, line 243
Returns:
size of data- 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/PagingTableDataSource.js, line 265
-
#startIndex() → {number}
-
Return current start index. -1 if initial fetch has not been done yet.
- Source:
- ojtable/PagingTableDataSource.js, line 123
Returns:
start index- Type
- number
-
#totalSize() → {number}
-
Return the total size of data available, including server side if not local.
- Source:
- ojtable/PagingTableDataSource.js, line 278
Returns:
total size of data- Type
- number