Constructor
new ArrayPagingDataSource(data)
Implementation of PagingModel backed by an array of data. ArrayPagingDataSource
provides a window into the array in both standard JavaScript array and Knockout observable array formats.
Parameters:
Name | Type | Description |
---|---|---|
data |
Array |
Methods
-
#fetch(options) → {Promise}
-
Fetch the row data.
Parameters:
Name Type Argument Description options
Object <optional>
Options to control fetch Properties
Name Type Description startIndex
number The index at which to start fetching records. silent
boolean If set, do not fire a sync event. Returns:
Promise object resolves to a compound object which contains an array of row data objects and the startIndex triggering done when complete.The structure of the resolved compound object is:
data An array of raw row data startIndex The startIndex for the returned set of rows - Type
- Promise
-
getCapability(feature) → {string|null}
-
Determines whether this DataSource supports the specified feature.
Parameters:
Name Type Description feature
string the feature in which its capabilities is inquired. - Inherited From:
- Source:
Returns:
the capability of the specified feature. Returns null if the feature is not recognized.- Type
- string | null
-
#getEndItemIndex() → {number}
-
Get the current page end index
Returns:
The current page end index- Type
- number
-
#getPage() → {number}
-
Get the current page
Returns:
The current page- Type
- number
-
#getPageCount() → {number}
-
Get the page count
Returns:
The total number of pages- Type
- number
-
#getStartItemIndex() → {number}
-
Get the current page start index
Returns:
The current page start index- Type
- number
-
getWindow() → {Array}
-
Returns:
the current set of data in the paging window- Type
- Array
-
getWindowObservable() → {Object}
-
Returns:
an observable array representing the current data in the paging window- Type
- Object
-
Init()
-
Initializes the instance.
-
off(eventType, eventHandler)
-
Detach an event handler
Parameters:
Name Type Description eventType
string eventType eventHandler
function(Object) event handler function - Inherited From:
- Source:
-
on(eventType, eventHandler)
-
Attach an event handler
Parameters:
Name Type Description eventType
string eventType eventHandler
function(Object) event handler function - Inherited From:
- Source:
-
#setPage(value, options) → {Promise}
-
Set the current page
Parameters:
Name Type Argument Description value
number The current page options
Object <optional>
Options pageSize: The page size.
Returns:
promise object triggering done when complete..- Type
- Promise
-
#totalSize() → {number}
-
Return the total size of data available, including server side if not local.
Returns:
total size of data- Type
- number