A control that contains a tree and associated data columns and provides helper methods for tree manipulation.
Call #setRootItems to provide a tree model.
Call #updateCollections after making changes to the tree hierarchy.
Call #updateModel after making changes to the tree model (either changes to the the tree hierarchy or changes to properties of tree items).
Items in the tree are plain JavaScript objects that have the following set of properties:
id
- The unique id for the tree item. This is the only required field in the tree item object.name
- The tree item name.iconUrl
- The URL string for the icon to show in the "tree" column.iconColor
- The color for the icon to show in the "tree" column.iconTooltip
- A tooltip for the icon to show in the "tree" column.absoluteMatrix
- An array of 13 numbers in ISO 10303-42 format representing an absolute transformation matrix.relativeMatrix
- An array of 13 numbers in ISO 10303-42 format representing a relative transformation matrix.includedChildren
- An array of tree items containing the children of this tree item that can be displayed in the tree.excludedChildren
- An array of tree items containing the children of this tree item that are not displayed in the tree.metadata
- A plain JavaScript object map containing metadata values for the tree item.string, string[]
, number
, number[]
, boolean
, boolean[]
, object
, object[]
.
identifiers
- A plain JavaScript object map containing VE9 identifier values for the tree item.appData
- A plain JavaScript object map containing application data values for the tree item.string, string[]
, number
, number[]
, boolean
, boolean[]
, object
, object[]
.
textColor
- A sap.ui.vtm.TextColor value that specifies the color of the text for the tree item in the Name data column (defaults to sap.ui.vtm.TextColor.Default).sceneNodeIds
- A string or array of strings containing the IDs of scene nodes to associate with this tree item.visibility
- Used to determine visibility of associated scene nodes and control a visibility icon shown in the sap.ui.vtm.InternalColumnDescriptor.Visibility column.true
associated scene nodes should be visible in the viewport (when their visibility is not overridden).false
associated scene nodes should not be visible in the viewport (when their visibility is not overridden).null
or undefined
no visibility icon is shown for the tree item and associated scene nodes should not be visible in the viewport (when their visibility is not overridden).opacity
- A numeric value between 0 and 1 (inclusive) that specifies the opacity to apply to associated scene nodes (when their opacity is not overridden).highlightColor
- A sap.ui.core.CSSColor that specifies a highlight color to apply to associated scene nodes (when their highlight color is not overridden). The alpha component specifies the blend ratio between the highlight color and the scene node color.messages
A string that can be parsed using JSON.parse() to produce an array of objects that can be used to construct sap.ui.core.Message objects.mSettings
parameter of the sap.ui.core.Message constructor for valid values.messageStatusIconUrl
The URL of the icon to display in the message status column. If an extension implementing sap.ui.vtm.interfaces.IMessageStatusCalculationExtension is being used, only that extension should set values for this field.messageStatusIconColor
The sap.ui.core.CSSColor color of the icon to display in the message status column. If an extension implementing sap.ui.vtm.interfaces.IMessageStatusCalculationExtension is being used, only that extension should set values for this field.messageStatusIconTooltip
The tooltip for the icon in the message status column. If an extension implementing sap.ui.vtm.interfaces.IMessageStatusCalculationExtension is being used, only that extension should set values for this field.The sceneNodeIds
, visibility
, opacity
and highlightColor
properties are used by the extension implementing sap.ui.vtm.interfaces.IDisplayStateCalculationExtension to determine the display state of scene nodes shown in the sap.ui.vtm.Viewport associated with the sap.ui.vtm.Tree.
Example:
{
id: jQuery.sap.uid(),
name: "Tree item name",
iconUrl: "sap-icon://tree",
iconTooltip: "Group"
absoluteMatrix: [0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1],
relativeMatrix: [0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1],
includedChildren: [],
metadata:{
'{"category":"SAP","field":"MATERIAL"}': ["mat1", "mat2"]]
},
identifiers: {
'{"source":"SAP","type":"VE_COMPONENT"}': '[{"name":"ID", "value":"_moto_x_asm"},{"name":"version", "value": "00"},{"name": "timestamp", "value":"2016-05-18 03:44:53.93"}]',
'{"source":"SAP","type":"MATERIAL"}': ['[{"name":"ID", "value":"mat1"}]', '[{"name":"ID", "value":"mat2"}]']
},
appData:{
"bomId: "bom1",
"bomItemId: "bomItem1",
},
textColor: sap.ui.vtm.TextColor.Gray,
sceneNodeIds: ["iffffffff01021520", "iffffffff01021528"],
visibility: true,
opacity: 0.3,
highlightColor: "rgba(0,255,0,0.8)"
messages: '[{"level":"Error","text":"some error"},{"level":"Error","text":"Another error"},{"level":"Warning","A warning"}]',
messageStatusIconUrl: "sap-icon://error",
messageStatusIconColor: "red",
messageStatusIconTooltip: "Error"
}
This class is not intended to be instantiated directly by application code. A sap.ui.vtm.Tree object is created when a sap.ui.vtm.Panel object is instantiated.
Accepts an object literal mSettings
that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.
new sap.ui.vtm.Tree(sId, mSettings)
Param | Type | Default Value | Description |
---|---|---|---|
sId | string | id for the new sap.ui.vtm.Tree. |
|
mSettings | object | Object with initial property values, aggregated objects etc. for the new sap.ui.vtm.Tree. |
Name | Type | Default Value | Description |
---|---|---|---|
selectionMode | sap.ui.vtm.SelectionMode | Single | The tree selection mode. Visibility: public |
Default Aggregation:
Name | Cardinality | Type | Description |
---|---|---|---|
_treeTable | 0..1 | sap.ui.table.TreeTable | |
headerControls | 0..n | sap.ui.core.Control |
A set of controls such as toolbars to show above the tree. |
Event | Description |
---|---|
beforeModelUpdated |
Raised before the model is updated. |
dataColumnsChanged |
Raised when the data columns are updated. |
dragOver |
Raised when a tree item is dragged over a tree item or an unpopulated row in a tree. To allow a drop to occur call preventDefault() on the event. Listeners may prevent the default action of this event by calling the |
dragStart |
Raised when a tree item drag is initiated. To prevent a drag from being initiated call preventDefault() on the event. Listeners may prevent the default action of this event by calling the |
drop |
Raised when a tree item is dropped on a tree item or an unpopulated row in a tree. A drop cannot occur unless preventDefault() is called on the sap.ui.base.Event object in the preceding dragOver event. |
expandedChanged |
Raised when a tree item entry is expanded or collapsed. |
fixedColumnsChanged |
Raised when the fixed columns are updated. |
hierarchyChanged |
Raised when the tree hierarchy (the set of parent child relationships) changes. |
messageStatusHeaderIconClicked |
Raised when a tree item message status icon is clicked. |
messageStatusIconClicked |
Raised when a tree item message status icon is clicked. |
modelUpdated |
Raised after the model has been updated. |
selectionChanged |
Raised when the set of selected tree items for a tree changes. |
visibilityHeaderIconClicked |
Raised when the icon in the visibility column header is clicked. |
visibilityIconClicked |
Raised when an icon in the visibility column is clicked. |
Raised before the model is updated.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object |
Raised when the data columns are updated.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object |
Raised when a tree item is dragged over a tree item or an unpopulated row in a tree. To allow a drop to occur call preventDefault() on the event.
Listeners may prevent the default action of this event by calling the preventDefault
method on the event object.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
dragItem | object |
The tree item that was dragged. |
dragTree | sap.ui.vtm.Tree |
The tree of the tree item that was dragged. |
dragOverItem | object |
The tree item being dragged over or null if the tree item is being dragged over an unpopulated row. |
dragOverTree | sap.ui.vtm.Tree |
The tree being dragged over. |
Raised when a tree item drag is initiated. To prevent a drag from being initiated call preventDefault() on the event.
Listeners may prevent the default action of this event by calling the preventDefault
method on the event object.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
dragItem | object |
The tree item that was dragged. |
dragTree | sap.ui.vtm.Tree |
The tree of the tree item that was dragged. |
Raised when a tree item is dropped on a tree item or an unpopulated row in a tree. A drop cannot occur unless preventDefault() is called on the sap.ui.base.Event object in the preceding dragOver event.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
dragItem | object |
The tree item that was dragged. |
dragTree | sap.ui.vtm.Tree |
The tree of the tree item that was dragged. |
dropItem | object |
The tree item that the drop occurred on or null if the item was not dropped on a tree item. |
dropTree | sap.ui.vtm.Tree |
The tree that the drop occurred on. |
Raised when a tree item entry is expanded or collapsed.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
item | object |
The tree item associated with the row that was expanded or collapsed. |
expanded | boolean |
If |
userInteraction | boolean |
Indicates that the event was fired due to the user clicking an expander. |
Raised when the fixed columns are updated.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object |
Raised when the tree hierarchy (the set of parent child relationships) changes.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object |
Raised when a tree item message status icon is clicked.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object |
Raised when a tree item message status icon is clicked.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
items | object |
The associated tree item. |
control | sap.ui.core.Control |
The message status icon control that was clicked. |
Raised after the model has been updated.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object |
Raised when the set of selected tree items for a tree changes.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
addedItems | object[] |
The tree items that were added to the selection set for the tree. |
removedItems | object[] |
The tree items that were removed from the selection set for the tree. |
userInteraction | boolean |
Indicates that the event was fired due to an explicit user interaction |
Raised when the icon in the visibility column header is clicked.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
visibility | boolean |
The visibility state of the tree item. |
control | sap.ui.core.Control |
The visibility header icon control that was clicked. |
Raised when an icon in the visibility column is clicked.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
item | object |
The tree item whose visibility icon was clicked. |
visibility | boolean |
The visibility state of the tree item. |
control | sap.ui.core.Control |
The visibility icon control that was clicked. |
Method | Description |
---|---|
addHeaderControl |
Adds some headerControl to the aggregation headerControls. |
addRoot |
Adds a root item to the tree. |
attachBeforeModelUpdated |
Attaches event handler When called, the context of the event handler (its Raised before the model is updated. |
attachDataColumnsChanged |
Attaches event handler When called, the context of the event handler (its Raised when the data columns are updated. |
attachDragOver |
Attaches event handler When called, the context of the event handler (its Raised when a tree item is dragged over a tree item or an unpopulated row in a tree. To allow a drop to occur call preventDefault() on the event. |
attachDragStart |
Attaches event handler When called, the context of the event handler (its Raised when a tree item drag is initiated. To prevent a drag from being initiated call preventDefault() on the event. |
attachDrop |
Attaches event handler When called, the context of the event handler (its Raised when a tree item is dropped on a tree item or an unpopulated row in a tree. A drop cannot occur unless preventDefault() is called on the sap.ui.base.Event object in the preceding dragOver event. |
attachExpandedChanged |
Attaches event handler When called, the context of the event handler (its Raised when a tree item entry is expanded or collapsed. |
attachFixedColumnsChanged |
Attaches event handler When called, the context of the event handler (its Raised when the fixed columns are updated. |
attachHierarchyChanged |
Attaches event handler When called, the context of the event handler (its Raised when the tree hierarchy (the set of parent child relationships) changes. |
attachMessageStatusHeaderIconClicked |
Attaches event handler When called, the context of the event handler (its Raised when a tree item message status icon is clicked. |
attachMessageStatusIconClicked |
Attaches event handler When called, the context of the event handler (its Raised when a tree item message status icon is clicked. |
attachModelUpdated |
Attaches event handler When called, the context of the event handler (its Raised after the model has been updated. |
attachSelectionChanged |
Attaches event handler When called, the context of the event handler (its Raised when the set of selected tree items for a tree changes. |
attachVisibilityHeaderIconClicked |
Attaches event handler When called, the context of the event handler (its Raised when the icon in the visibility column header is clicked. |
attachVisibilityIconClicked |
Attaches event handler When called, the context of the event handler (its Raised when an icon in the visibility column is clicked. |
collapseAll |
Expands all tree items in the tree. |
destroyHeaderControls |
Destroys all the headerControls in the aggregation headerControls. |
detachBeforeModelUpdated |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachDataColumnsChanged |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachDragOver |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachDragStart |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachDrop |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachExpandedChanged |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachFixedColumnsChanged |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachHierarchyChanged |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachMessageStatusHeaderIconClicked |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachMessageStatusIconClicked |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachModelUpdated |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachSelectionChanged |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachVisibilityHeaderIconClicked |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachVisibilityIconClicked |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
expandAll |
Expands all tree items in the tree. |
expandAncestors |
Expands all ancestors of specified tree item. This method relies on #updateCollections being called after the tree is populated/changed. |
expandToLevel |
Expands tree items in the tree from the root down to the given level. |
sap.ui.vtm.Tree.extend |
Creates a new subclass of class sap.ui.vtm.Tree with name
|
fireBeforeModelUpdated |
Fires event beforeModelUpdated to attached listeners. |
fireDataColumnsChanged |
Fires event dataColumnsChanged to attached listeners. |
fireDragOver |
Fires event dragOver to attached listeners. Listeners may prevent the default action of this event by calling the |
fireDragStart |
Fires event dragStart to attached listeners. Listeners may prevent the default action of this event by calling the |
fireDrop |
Fires event drop to attached listeners. |
fireExpandedChanged |
Fires event expandedChanged to attached listeners. |
fireFixedColumnsChanged |
Fires event fixedColumnsChanged to attached listeners. |
fireHierarchyChanged |
Fires event hierarchyChanged to attached listeners. |
fireMessageStatusHeaderIconClicked |
Fires event messageStatusHeaderIconClicked to attached listeners. |
fireMessageStatusIconClicked |
Fires event messageStatusIconClicked to attached listeners. |
fireModelUpdated |
Fires event modelUpdated to attached listeners. |
fireSelectionChanged |
Fires event selectionChanged to attached listeners. |
fireVisibilityHeaderIconClicked |
Fires event visibilityHeaderIconClicked to attached listeners. |
fireVisibilityIconClicked |
Fires event visibilityIconClicked to attached listeners. |
getAllItems |
Finds all tree items in the tree of a given type. This method relies on #updateCollections being called after the tree is populated/changed. |
getAncestorItems |
Finds all ancestors of a tree item. An empty array will be returned for root items.
This method relies on #updateCollections being called after the tree is populated/changed. |
getDataColumns |
Gets the set of data columns for the tree. |
getDescendantItems |
Gets the descendants of a tree item. This method relies on #updateCollections being called after the tree is populated/changed. |
getExpanded |
Gets whether the row associated with a tree item is expanded. This method relies on #updateCollections being called after the tree is populated/changed. |
getFixedColumns |
Gets the fixed columns for the tree. |
getHeaderControls |
Gets content of aggregation headerControls. A set of controls such as toolbars to show above the tree. |
getHighlightColor |
Gets the If a single tree item is passed to the method then a single value is returned. |
getItem |
Finds a tree item by id or returns undefined if it is not found. This method relies on #updateCollections being called after the tree is populated/changed. |
getItemByBindingContextPath |
Finds a tree item by binding context path or returns undefined if it is not found. This is typically used to find the corresponding tree item in event handlers for custom column template controls. |
getItemsBySceneNodeId |
Finds the set of tree items that are associated with a particular scene node id. This method relies on #updateCollections being called after the tree is populated/changed. |
sap.ui.vtm.Tree.getMetadata |
Returns a metadata object for class sap.ui.vtm.Tree. |
getOpacity |
Gets the If a single tree item is passed to the method then a single value is returned. |
getPanel |
Gets the panel this tree belongs to. |
getParentItem |
Finds a parent tree item or returns undefined if it is not found. This method relies on #updateCollections being called after the tree is populated/changed. |
getRootItems |
Gets the root tree items. |
getSelectedItems |
Gets the selected tree items. |
getSelectionMode |
Gets current value of property selectionMode. The tree selection mode. Default value is |
getVisibility |
Gets the If a single tree item is passed to the method then a single value is returned. |
indexOfHeaderControl |
Checks for the provided |
insertHeaderControl |
Inserts a headerControl into the aggregation headerControls. |
isEmpty |
Returns whether the tree is empty. |
isExcludedItem |
Returns whether a tree item object is an excluded tree item in the tree model of this sap.ui.vtm.Tree. This method relies on #updateCollections being called after the tree is populated/changed. |
isIncludedItem |
Returns whether a tree item object is an included tree item in the tree model of this sap.ui.vtm.Tree. This method relies on #updateCollections being called after the tree is populated/changed. |
removeAllHeaderControls |
Removes all the controls from the aggregation headerControls. Additionally, it unregisters them from the hosting UIArea. |
removeHeaderControl |
Removes a headerControl from the aggregation headerControls. |
removeRoot |
Removes a root item from the tree. |
scrollIntoView |
Brings specified tree item to view, expanding the tree if necessary. This method relies on #updateCollections being called after the tree is populated/changed. |
setDataColumns |
Sets the data columns for the tree. |
setExpanded |
Expands or collapses the row associated with a tree item. This method relies on #updateCollections being called after the tree is populated/changed. |
setFixedColumns |
Sets the fixed columns for the tree. |
setHighlightColor |
Sets the |
setOpacity |
Sets the |
setRootItems |
Sets the root tree items. |
setSelectedItems |
Sets the selected tree items. This method relies on #updateCollections being called after the tree is populated/changed. |
setSelectionMode |
Sets a new value for property selectionMode. The tree selection mode. When called with a value of Default value is |
setVisibility |
Sets the |
traverseBranch |
Recursively traverses a tree branch calling a function on each item (including the tree item that is the root of the branch). |
traverseTree |
Recursively traverses the tree calling a function on each item. |
updateCollections |
Updates collections used to find tree items by various criteria.
Correct usage of this method is required by the following methods:
* When the only changes to the tree since the last call to #updateCollections are changes to the sceneNodeIds |
updateModel |
Updates the model. The application should call this whenever changes are made to the tree model. |
updateTreeItemsBySceneNodeId |
Update the collection used by #getItemsBySceneNodeId. This is useful when the only changes to the tree since the last call to #updateCollections are changes to the |
validateTree |
Validates the tree. If errors are found they are written to the console log and an exception is thrown. |
Adds some headerControl to the aggregation headerControls.
Param | Type | DefaultValue | Description |
---|---|---|---|
oHeaderControl | sap.ui.core.Control |
The headerControl to add; if empty, nothing is inserted |
Adds a root item to the tree.
Param | Type | DefaultValue | Description |
---|---|---|---|
rootItemToAdd | object |
The root tree item to remove. |
Attaches event handler fnFunction
to the beforeModelUpdated event of this sap.ui.vtm.Tree
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.vtm.Tree
itself.
Raised before the model is updated.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Attaches event handler fnFunction
to the dataColumnsChanged event of this sap.ui.vtm.Tree
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.vtm.Tree
itself.
Raised when the data columns are updated.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Attaches event handler fnFunction
to the dragOver event of this sap.ui.vtm.Tree
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.vtm.Tree
itself.
Raised when a tree item is dragged over a tree item or an unpopulated row in a tree. To allow a drop to occur call preventDefault() on the event.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Attaches event handler fnFunction
to the dragStart event of this sap.ui.vtm.Tree
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.vtm.Tree
itself.
Raised when a tree item drag is initiated. To prevent a drag from being initiated call preventDefault() on the event.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Attaches event handler fnFunction
to the drop event of this sap.ui.vtm.Tree
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.vtm.Tree
itself.
Raised when a tree item is dropped on a tree item or an unpopulated row in a tree. A drop cannot occur unless preventDefault() is called on the sap.ui.base.Event object in the preceding dragOver event.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Attaches event handler fnFunction
to the expandedChanged event of this sap.ui.vtm.Tree
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.vtm.Tree
itself.
Raised when a tree item entry is expanded or collapsed.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Attaches event handler fnFunction
to the fixedColumnsChanged event of this sap.ui.vtm.Tree
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.vtm.Tree
itself.
Raised when the fixed columns are updated.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Attaches event handler fnFunction
to the hierarchyChanged event of this sap.ui.vtm.Tree
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.vtm.Tree
itself.
Raised when the tree hierarchy (the set of parent child relationships) changes.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Attaches event handler fnFunction
to the messageStatusHeaderIconClicked event of this sap.ui.vtm.Tree
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.vtm.Tree
itself.
Raised when a tree item message status icon is clicked.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Attaches event handler fnFunction
to the messageStatusIconClicked event of this sap.ui.vtm.Tree
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.vtm.Tree
itself.
Raised when a tree item message status icon is clicked.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Attaches event handler fnFunction
to the modelUpdated event of this sap.ui.vtm.Tree
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.vtm.Tree
itself.
Raised after the model has been updated.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Attaches event handler fnFunction
to the selectionChanged event of this sap.ui.vtm.Tree
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.vtm.Tree
itself.
Raised when the set of selected tree items for a tree changes.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Attaches event handler fnFunction
to the visibilityHeaderIconClicked event of this sap.ui.vtm.Tree
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.vtm.Tree
itself.
Raised when the icon in the visibility column header is clicked.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Attaches event handler fnFunction
to the visibilityIconClicked event of this sap.ui.vtm.Tree
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.vtm.Tree
itself.
Raised when an icon in the visibility column is clicked.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Detaches event handler fnFunction
from the beforeModelUpdated event of this sap.ui.vtm.Tree
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Detaches event handler fnFunction
from the dataColumnsChanged event of this sap.ui.vtm.Tree
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Detaches event handler fnFunction
from the dragOver event of this sap.ui.vtm.Tree
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Detaches event handler fnFunction
from the dragStart event of this sap.ui.vtm.Tree
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Detaches event handler fnFunction
from the drop event of this sap.ui.vtm.Tree
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Detaches event handler fnFunction
from the expandedChanged event of this sap.ui.vtm.Tree
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Detaches event handler fnFunction
from the fixedColumnsChanged event of this sap.ui.vtm.Tree
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Detaches event handler fnFunction
from the hierarchyChanged event of this sap.ui.vtm.Tree
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Detaches event handler fnFunction
from the messageStatusHeaderIconClicked event of this sap.ui.vtm.Tree
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Detaches event handler fnFunction
from the messageStatusIconClicked event of this sap.ui.vtm.Tree
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Detaches event handler fnFunction
from the modelUpdated event of this sap.ui.vtm.Tree
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Detaches event handler fnFunction
from the selectionChanged event of this sap.ui.vtm.Tree
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Detaches event handler fnFunction
from the visibilityHeaderIconClicked event of this sap.ui.vtm.Tree
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Detaches event handler fnFunction
from the visibilityIconClicked event of this sap.ui.vtm.Tree
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Expands all ancestors of specified tree item.
This method relies on #updateCollections being called after the tree is populated/changed.
Param | Type | DefaultValue | Description |
---|---|---|---|
treeItem | object |
Tree item. |
Expands tree items in the tree from the root down to the given level.
Param | Type | DefaultValue | Description |
---|---|---|---|
iLevel | int |
The tree level to expand to. |
Creates a new subclass of class sap.ui.vtm.Tree with name sClassName
and enriches it with the information contained in oClassInfo
.
oClassInfo
might contain the same kind of information as described in sap.ui.core.Control.extend.
Param | Type | DefaultValue | Description |
---|---|---|---|
sClassName | string |
Name of the class being created |
|
oClassInfo | object |
Object literal with information about the class |
|
FNMetaImpl | function |
Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class |
Fires event beforeModelUpdated to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Fires event dataColumnsChanged to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Fires event dragOver to attached listeners.
Listeners may prevent the default action of this event by calling the preventDefault
method on the event object. The return value of this method indicates whether the default action should be executed.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
dragItem | object |
The tree item that was dragged. |
|
dragTree | sap.ui.vtm.Tree |
The tree of the tree item that was dragged. |
|
dragOverItem | object |
The tree item being dragged over or null if the tree item is being dragged over an unpopulated row. |
|
dragOverTree | sap.ui.vtm.Tree |
The tree being dragged over. |
Fires event dragStart to attached listeners.
Listeners may prevent the default action of this event by calling the preventDefault
method on the event object. The return value of this method indicates whether the default action should be executed.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
dragItem | object |
The tree item that was dragged. |
|
dragTree | sap.ui.vtm.Tree |
The tree of the tree item that was dragged. |
Fires event drop to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
dragItem | object |
The tree item that was dragged. |
|
dragTree | sap.ui.vtm.Tree |
The tree of the tree item that was dragged. |
|
dropItem | object |
The tree item that the drop occurred on or null if the item was not dropped on a tree item. |
|
dropTree | sap.ui.vtm.Tree |
The tree that the drop occurred on. |
Fires event expandedChanged to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
item | object |
The tree item associated with the row that was expanded or collapsed. |
|
expanded | boolean |
If |
|
userInteraction | boolean |
Indicates that the event was fired due to the user clicking an expander. |
Fires event fixedColumnsChanged to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Fires event hierarchyChanged to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Fires event messageStatusHeaderIconClicked to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Fires event messageStatusIconClicked to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
items | object |
The associated tree item. |
|
control | sap.ui.core.Control |
The message status icon control that was clicked. |
Fires event modelUpdated to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Fires event selectionChanged to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
addedItems | object[] |
The tree items that were added to the selection set for the tree. |
|
removedItems | object[] |
The tree items that were removed from the selection set for the tree. |
|
userInteraction | boolean |
Indicates that the event was fired due to an explicit user interaction |
Fires event visibilityHeaderIconClicked to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
visibility | boolean |
The visibility state of the tree item. |
|
control | sap.ui.core.Control |
The visibility header icon control that was clicked. |
Fires event visibilityIconClicked to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
item | object |
The tree item whose visibility icon was clicked. |
|
visibility | boolean |
The visibility state of the tree item. |
|
control | sap.ui.core.Control |
The visibility icon control that was clicked. |
Finds all tree items in the tree of a given type.
This method relies on #updateCollections being called after the tree is populated/changed.
Param | Type | DefaultValue | Description |
---|---|---|---|
treeItemType | sap.ui.vtm.TreeItemType |
Indicates the types of tree item to match. Defaults to sap.ui.vtm.TreeItemType.Included. |
Finds all ancestors of a tree item.
An empty array will be returned for root items.
Otherwise an array of ancestor tree items will be returned.
The array will be ordered such that:
This method relies on #updateCollections being called after the tree is populated/changed.
Param | Type | DefaultValue | Description |
---|---|---|---|
treeItem | object string |
The tree item or id of the tree item to get the ancestors of. |
Gets the descendants of a tree item.
This method relies on #updateCollections being called after the tree is populated/changed.
Param | Type | DefaultValue | Description |
---|---|---|---|
treeItem | object string |
The tree item or id of the tree item to get the descendants of. |
|
treeItemType | sap.ui.vtm.TreeItemType |
Indicates the types of tree item to match. Defaults to sap.ui.vtm.TreeItemType.Included. |
Gets whether the row associated with a tree item is expanded.
This method relies on #updateCollections being called after the tree is populated/changed.
Param | Type | DefaultValue | Description |
---|---|---|---|
oTreeItem | object |
The tree item. |
Gets content of aggregation headerControls.
A set of controls such as toolbars to show above the tree.
Gets the highlightColor
property of a tree item or array of tree items.
If a single tree item is passed to the method then a single value is returned.
If an array of tree items is passed to the method then an array is returned.
Param | Type | DefaultValue | Description |
---|---|---|---|
treeItems | object object[] |
The tree item or the array of tree items. |
Finds a tree item by id or returns undefined if it is not found. This method relies on #updateCollections being called after the tree is populated/changed.
Param | Type | DefaultValue | Description |
---|---|---|---|
treeItemId | string |
The tree item id to look for. |
Finds a tree item by binding context path or returns undefined if it is not found. This is typically used to find the corresponding tree item in event handlers for custom column template controls.
Param | Type | DefaultValue | Description |
---|---|---|---|
bindingContextPath | string |
The binding context path to look for. |
Finds the set of tree items that are associated with a particular scene node id.
This method relies on #updateCollections being called after the tree is populated/changed.
Param | Type | DefaultValue | Description |
---|---|---|---|
sceneNodeIds | string string[] |
The scene node ID or IDs to find. |
|
treeItemType | sap.ui.vtm.TreeItemType |
Indicates the types of tree item to match. Defaults to sap.ui.vtm.TreeItemType.Included. |
Gets the opacity
property of a tree item or array of tree items.
If a single tree item is passed to the method then a single value is returned.
If an array of tree items is passed to the method then an array is returned.
Param | Type | DefaultValue | Description |
---|---|---|---|
treeItems | object object[] |
The tree item or the array of tree items. |
Finds a parent tree item or returns undefined if it is not found.
This method relies on #updateCollections being called after the tree is populated/changed.
Param | Type | DefaultValue | Description |
---|---|---|---|
treeItem | object string |
The child tree item or child tree item id. |
Gets current value of property selectionMode.
The tree selection mode.
Default value is "Single"
.
Gets the visibility
property of a tree item or array of tree items.
If a single tree item is passed to the method then a single value is returned.
If an array of tree items is passed to the method then an array is returned.
Param | Type | DefaultValue | Description |
---|---|---|---|
treeItems | object object[] |
The tree item or the array of tree items. |
Checks for the provided sap.ui.core.Control
in the aggregation headerControls. and returns its index if found or -1 otherwise.
Param | Type | DefaultValue | Description |
---|---|---|---|
oHeaderControl | sap.ui.core.Control |
The headerControl whose index is looked for |
Inserts a headerControl into the aggregation headerControls.
Param | Type | DefaultValue | Description |
---|---|---|---|
oHeaderControl | sap.ui.core.Control |
The headerControl to insert; if empty, nothing is inserted |
|
iIndex | int |
The |
Returns whether a tree item object is an excluded tree item in the tree model of this sap.ui.vtm.Tree.
This method relies on #updateCollections being called after the tree is populated/changed.
Param | Type | DefaultValue | Description |
---|---|---|---|
treeItem | object string |
The tree item or tree item id to check. |
Returns whether a tree item object is an included tree item in the tree model of this sap.ui.vtm.Tree.
This method relies on #updateCollections being called after the tree is populated/changed.
Param | Type | DefaultValue | Description |
---|---|---|---|
treeItem | object string |
The tree item or tree item id to check. |
Removes all the controls from the aggregation headerControls.
Additionally, it unregisters them from the hosting UIArea.
Removes a headerControl from the aggregation headerControls.
Param | Type | DefaultValue | Description |
---|---|---|---|
vHeaderControl | int string sap.ui.core.Control |
The headerControl to remove or its index or id |
Removes a root item from the tree.
Param | Type | DefaultValue | Description |
---|---|---|---|
rootItemToRemove | string object |
The root tree item to remove (or its id). |
Brings specified tree item to view, expanding the tree if necessary.
This method relies on #updateCollections being called after the tree is populated/changed.
Param | Type | DefaultValue | Description |
---|---|---|---|
treeItem | object |
The tree item to scroll into view. |
Sets the data columns for the tree.
Param | Type | DefaultValue | Description |
---|---|---|---|
dataColumns | sap.ui.vtm.Column[] |
The data columns for the tree. |
Expands or collapses the row associated with a tree item.
This method relies on #updateCollections being called after the tree is populated/changed.
Param | Type | DefaultValue | Description |
---|---|---|---|
oTreeItem | object |
The tree item. |
|
bExpanded | boolean |
If |
Sets the fixed columns for the tree.
Param | Type | DefaultValue | Description |
---|---|---|---|
fixedColumns | sap.ui.vtm.Column[] |
The fixed columns. |
Sets the highlightColor
property of some tree items.
Param | Type | DefaultValue | Description |
---|---|---|---|
treeItems | object object[] |
The tree item or the array of tree items. |
|
highlightColor | sap.ui.core.CSSColor |
The new highlight color value of the tree items. |
|
recursive | boolean |
If |
|
visualOnly | boolean |
If |
|
refresh | boolean |
If |
Sets the opacity
property of some tree items.
Param | Type | DefaultValue | Description |
---|---|---|---|
treeItems | object object[] |
The tree item or the array of tree items. |
|
opacity | float |
The new opacity value of the tree items (between 0.0 and 1.0 inclusive). |
|
recursive | boolean |
If |
|
visualOnly | boolean |
If |
|
refresh | boolean |
If |
Sets the root tree items.
Param | Type | DefaultValue | Description |
---|---|---|---|
rootItems | object[] |
The root tree items. |
Sets the selected tree items.
This method relies on #updateCollections being called after the tree is populated/changed.
Param | Type | DefaultValue | Description |
---|---|---|---|
items | object object[] |
Tree item(s) to select in the tree. |
|
scrollToView | boolean |
When set brings selected item into view. Default value is to true. |
Sets a new value for property selectionMode.
The tree selection mode.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is "Single"
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sSelectionMode | sap.ui.vtm.SelectionMode | "Single" |
New value for property |
Sets the visibility
property of some tree items.
Param | Type | DefaultValue | Description |
---|---|---|---|
treeItems | object object[] |
The tree item or the array of tree items. |
|
visibility | boolean |
The new visibility state of the tree items. |
|
recursive | boolean |
If |
|
visualOnly | boolean |
If |
|
refresh | boolean |
If |
Recursively traverses a tree branch calling a function on each item (including the tree item that is the root of the branch).
Param | Type | DefaultValue | Description |
---|---|---|---|
treeItem | object |
The root of the branch to apply the function to. |
|
callback | function |
The function to apply to tree items in the branch. |
Recursively traverses the tree calling a function on each item.
Param | Type | DefaultValue | Description |
---|---|---|---|
callback | function |
The function to apply to tree items in the tree. |
Updates collections used to find tree items by various criteria.
This method should be called whenever the tree has been populated, when the tree structure has changed or when any of the following fields have been modified for a tree item in the tree:
sceneNodeIds properties of the tree items, #updateTreeItemsBySceneNodeId can be used instead of #updateCollections.
Param
Type
DefaultValue
Description
checkForHierarchyChanges
boolean
When true a hierarchyChanged
event will be raised if the hierarchy has changed since the last time this method was called. This method is called when the tree is empty as part of the sap.ui.vtm.Tree constructor, so the first time it is called from application code a hierarchyChanged
event will be raised if the tree has been populated. The default value for the parameter is true
.
Updates the model.
The application should call this whenever changes are made to the tree model.
Param | Type | DefaultValue | Description |
---|---|---|---|
forceRecreate | boolean |
If |
Update the collection used by #getItemsBySceneNodeId.
This is useful when the only changes to the tree since the last call to #updateCollections are changes to the sceneNodeIds
properties of the tree items.