Usage
For additional information visit:
Final classes in JET
Classes in JET are generally final and do not support subclassing. At the moment, final is not enforced. However, this will likely change in an upcoming JET release.
Constructor
new FlattenedTreeDataSource(treeDataSource, options)
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) : {undefined}
-
Collapse the specified row.
Parameters:
Name Type Description rowKey
any the key of the row to collapse Returns:
- Type
- undefined
-
Destroy : {undefined}
-
Destroy the data source.
Returns:
- Type
- undefined
-
expand(rowKey) : {undefined}
-
Expand the specified row.
Parameters:
Name Type Description rowKey
any the key of the row to expand Returns:
- Type
- undefined
-
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
any 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}
-
Retrieves 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 canceled
- Type
- boolean
-
move(rowToMove, referenceRow, position, callbacks) : {undefined}
-
Moves a row from one location to another (different position within the same parent or a completely different parent)
Parameters:
Name Type Argument Description rowToMove
any the key of the row to move referenceRow
any 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
Object <optional>
the callback to invoke when the move completed. Properties:
Name Type Description callbacks.error
function({status: Object}) the callback to invoke when move failed. callbacks.success
function() the callback to invoke when the move completed successfully. Returns:
- Type
- undefined
-
moveOK(rowToMove, referenceRow, position) : {string}
-
Checks whether a move operation is valid.
Parameters:
Name Type Description rowToMove
any the key of the row to move referenceRow
any 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) : {void}
-
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:
Returns:
- Type
- void
-
on(eventType, eventHandler) : {void}
-
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:
Returns:
- Type
- void