Class: FlattenedTreeDataSource

Oracle® JavaScript Extension Toolkit (JET)
4.2.0

E91398-01

QuickNav

oj. FlattenedTreeDataSource extends oj.DataSource

Version:
  • 4.2.0

Constructor

new FlattenedTreeDataSource(treeDataSource, options)

Base class for FlattenedTreeDataGridDataSource and FlattenedTreeTableDataSource
Parameters:
Name Type Argument Description
treeDataSource Object the instance of TreeDataSource to flattened
options Object <optional>
the options set on the FlattenedDataSource

Methods

collapse(rowKey)

Collapse the specified row.
Parameters:
Name Type Description
rowKey Object the key of the row to collapse

Destroy()

Destroy the data source.

expand(rowKey)

Expand the specified row.
Parameters:
Name Type Description
rowKey Object the key of the row to expand

#getCapability(feature) → {string|null}

Determines whether this data source supports certain feature.
Parameters:
Name Type Description
feature string the feature in which its capabilities is inquired. Currently the only valid feature is "sort".
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

getChildCount(parent) → {number}

Returns the number of children for a specified parent. If the value returned is not >= 0 then it is automatically assumed that the child count is unknown.
Parameters:
Name Type Description
parent Object the parent key. Specify null if inquiring child count of the root.
Returns:
the number of children for the specified parent.
Type
number

getExpandedKeys() → {Array.<Object>|string}

Retrieves the expanded row keys
Returns:
an array of expanded row keys or 'all' if all rows are expanded.
Type
Array.<Object> | string

getOption(option) → {Object}

Retreives the value of the specified option.
Parameters:
Name Type Description
option string the option to retrieve the value.
Returns:
the value of the specified option. Returns null if the value is null or if the option is not recognized.
Type
Object

getSortCriteria() → {Object}

Returns the current sort criteria of the tree data.
Returns:
the current sort criteria. It should contain the following properties: key, direction where criteria.key the key identifying the attribute (column) to sort on. Value is null if it's not sorted. criteria.direction the sort direction, valid values are "ascending", "descending", "none" (default)
Type
Object

getWrappedDataSource() → {Object}

Retrieves the underlying TreeDataSource.
Returns:
the underlying oj.TreeDataSource.
Type
Object

handleEvent(eventType, event) → {boolean}

Handle the event
Parameters:
Name Type Description
eventType string event type
event Object event
Returns:
Returns false if event is cancelled
Type
boolean

Init()

Initializes the data source.

move(rowToMove, referenceRow, position)

Moves a row from one location to another (different position within the same parent or a completely different parent)
Parameters:
Name Type Description
rowToMove Object the key of the row to move
referenceRow Object the key of the reference row which combined with position are used to determine the destination of where the row should moved to.
position number | string The position of the moved row relative to the reference row. This can be a string: "before", "after", "inside", "first", "last", or the zero based index to position the element at a specific point among the reference row's current children.
callbacks.success function() the callback to invoke when the move completed successfully.
callbacks.error function({status: Object}) the callback to invoke when move failed.

moveOK(rowToMove, referenceRow, position) → {string}

Checks whether a move operation is valid.
Parameters:
Name Type Description
rowToMove Object the key of the row to move
referenceRow Object the key of the reference row which combined with position are used to determine the destination of where the row should moved to.
position number | string The position of the moved row relative to the reference row. This can be a string: "before", "after", "inside", "first", "last", or the zero based index to position the element at a specific point among the reference row's current children.
Returns:
returns "valid" if the move is valid, "invalid" otherwise.
Type
string

off(eventType, eventHandler)

Detach an event handler.

Application can call this if it no longer wants to be notified of an event that it has attached an handler to using the on method.

Parameters:
Name Type Description
eventType string eventType
eventHandler function(Object) event handler function
Inherited From:

on(eventType, eventHandler)

Attach an event handler.

Application can call this if it wants to be notified of an event. It can call the off method to detach the handler when it no longer wants to be notified.

Parameters:
Name Type Description
eventType string eventType
eventHandler function(Object) event handler function
Inherited From: