Class: CollectionDataGridDataSource

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

E54107-01

QuickNav

oj. CollectionDataGridDataSource extends oj.DataGridDataSource

Constructor

new CollectionDataGridDataSource(collection, options)

An OJ Collection based implementation of the DataGridDataSource.
Parameters:
Name Type Argument Description
collection Object the oj collection to adapter the DataGridDataSource
options Object <optional>
optional settings on this oj collection data source
Properties
Name Type Argument Description
rowHeader string <optional>
the key of the attribute designated as the row header
columns Array.<string> <optional>
explicitly specifies columns to display and in what order. These columns must be a subset of attributes from Model. * @constructor
Source:

Methods

_handleHeaderFetchSuccess(headerRange, callbacks, callbackObjects)

Handle success fetchHeaders request
Parameters:
Name Type Argument Description
headerRange Object information about the header range, it must contain the following properties: axis, start, count.
Properties
Name Type Description
axis string the axis of the header that are fetched. Valid values are "row" and "column".
start number the start index of the range in which the header data are fetched.
count number the size of the range in which the header data are fetched.
callbacks Object the callbacks to be invoke when fetch headers operation is completed. The valid callback types are "success" and "error".
Properties
Name Type Description
success function(HeaderSet) the callback to invoke when fetch headers completed successfully.
error function({status: Object}) the callback to invoke when fetch cells failed.
callbackObjects Object <optional>
the object in which the callback function is invoked on. This is optional. You can specify the callback object for each callbacks using the "success" and "error" keys.
Source:

#fetch()

Perform a fetch call from the options specified
Source:

fetchCells(cellRanges, callbacks, callbackObjects)

Fetch a range of cells from the data source.
Parameters:
Name Type Argument Description
cellRanges Array.<Object> Information about the cell range. A cell range is defined by an array of range info for each axis, where each range contains three properties: axis, start, count.
Properties
Name Type Description
axis string the axis associated with this range where cells are fetched. Valid values are "row" and "column".
start number the start index of the range for this axis in which the cells are fetched.
count number the size of the range for this axis in which the cells are fetched.
callbacks Object the callbacks to be invoke when fetch cells operation is completed. The valid callback types are "success" and "error".
Properties
Name Type Description
success function(CellSet) the callback to invoke when fetch cells completed successfully.
error function({status: Object}) the callback to invoke when fetch cells failed.
callbackObjects Object <optional>
the object in which the callback function is invoked on. This is optional. You can specify the callback object for each callbacks using the "success" and "error" keys.
Source:

fetchHeaders(headerRange, callbacks, callbackObjects)

Fetch a range of headers from the data source.
Parameters:
Name Type Argument Description
headerRange Object information about the header range, it must contain the following properties: axis, start, count.
Properties
Name Type Description
axis string the axis of the header that are fetched. Valid values are "row" and "column".
start number the start index of the range in which the header data are fetched.
count number the size of the range in which the header data are fetched.
callbacks Object the callbacks to be invoke when fetch headers operation is completed. The valid callback types are "success" and "error".
Properties
Name Type Description
success function(HeaderSet) the callback to invoke when fetch headers completed successfully.
error function({status: Object}) the callback to invoke when fetch cells failed.
callbackObjects Object <optional>
the object in which the callback function is invoked on. This is optional. You can specify the callback object for each callbacks using the "success" and "error" keys.
Source:

getCapability(feature) → {string|null}

Determines whether this DataGridDataSource 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

getCollection()

Gets the collection property
Source:

getColumns()

Gets the columns property
Source:

getCount(axis) → {number}

Returns the total number of rows or columns. If the value return is not >= 0 then it is automatically assumed that the total count is unknown. In the case of paging returns the total number of rows/colums on the page.
Parameters:
Name Type Description
axis string the axis in which we inquire for the total count. Valid values are "row" and "column".
Source:
Returns:
the total number of rows/columns.
Type
number

getCountPrecision(axis) → {string}

Returns whether the total count returned in getCount function is an actual or an estimate.
Parameters:
Name Type Description
axis string the axis in which we inquire whether the total count is an estimate. Valid values are "row" and "column".
Source:
Returns:
"actual" if the count returned in getCount function is the actual count, "estimate" if the count returned in getCount function is an estimate. The default value is "actual".
Type
string

getData()

Gets the data property
Source:

getFetchCalls()

Gets the _fetchCalls property
Source:

getPageSize()

Gets the _pageSize property
Source:

getRowHeader()

Gets the rowHeader property
Source:

getStartIndex()

Gets the _startIndex property
Source:

getTotalSize()

Gets the _totalSize property
Source:

handleEvent(eventType, event)

Handle the event
Parameters:
Name Type Description
eventType string event type
event Object event
Inherited From:
Source:

#hasMore() → {boolean}

Source:
Returns:
whether there is more data
Type
boolean

indexes(keys) → {Object.<number, number>}

Returns the row and column index based on the keys.
Parameters:
Name Type Description
keys Object the key for each axis
Properties
Name Type Description
row Object the key for the row axis
column Object the key for the column axis
Source:
Returns:
indexes an object containing the index for each axis
Type
Object.<number, number>

Init()

Initial the OJ collection based data source.
Source:

keys(indexes) → {Object.<Object, Object>}

Returns the keys based on the indexes.
Parameters:
Name Type Description
indexes Object the index for each axis
Properties
Name Type Description
row Object the index for the row axis
column Object the index for the column axis
Source:
Returns:
an object containing the keys for each axis
Type
Object.<Object, Object>

move()

Move a model to a new index in the collection, if atKey is null adds to the end
Source:

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
Inherited From:
Source:

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
Inherited From:
Source:

setPageSize(n)

Set or change the number of models in a page
Parameters:
Name Type Description
n number page size
Source:

#size() → {number}

Source:
Returns:
length of the collection
Type
number

sort(criteria, callbacks, callbackObjects)

Performs a sort on the data source.
Parameters:
Name Type Argument Description
criteria Object the sort criteria.
Properties
Name Type Description
axis string The axis in which the sort is performed, valid values are "row", "column"
key Object The key that identifies which header to sort
direction string the sort direction, valid values are "ascending", "descending", "none" (default)
callbacks Object the callbacks to be invoke upon completion of the sort operation. The callback properties are "success" and "error".
Properties
Name Type Description
success function() the callback to invoke when the sort completed successfully.
error function({status: Object}) the callback to invoke when sort failed.
callbackObjects Object <optional>
the object in which the callback function is invoked on. This is optional. You can specify the callback object for each callbacks using the "success" and "error" properties.
Source:

#totalSize() → {number}

Source:
Returns:
total size of data
Type
number

Non-public Methods

<protected> _getModelEvent(operation, rowKey, columnKey) → {Object}

Returns an Object for an event
Parameters:
Name Type Description
operation string the operation done on the model
rowKey Object | null the key for the row axis
columnKey Object | null the key for the column axis
Source:
Returns:
an object containing the the source, operation, and keys of the event
Type
Object

<protected> _handleCollectionRefresh()

Handle a colelction reset, by passing refresh to the data grid
Source:

<protected> _handleModelAdded(model)

Handle a model add to the collection
Parameters:
Name Type Description
model Object The model being added to the collection
Source:

<protected> _handleModelChanged(model)

Handle a model change in the collection
Parameters:
Name Type Description
model Object The model being changed in the collection
Source:

<protected> _handleModelDeleted(model)

Handle a model delete from the collection
Parameters:
Name Type Description
model Object The model being deleted from the collection
Source: