sap.ui.table.TreeTable.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.table.TreeTable 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.table.Table.extend.
Parameters:
{string} | sClassName | Name of the class being created |
{object} | oClassInfo? | Object literal with information about the class |
{function} | FNMetaImpl? | Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata |
Returns:
{function} | Created class / constructor function |
Returns a metadata object for class sap.ui.table.TreeTable.
Returns:
Marks a range of tree nodes as selected, starting with iFromIndex going to iToIndex. The TreeNodes are referenced via their absolute row index. Please be aware, that the absolute row index only applies to the the tree which is visualized by the TreeTable. Invisible nodes (collapsed child nodes) will not be regarded.
Please also take notice of the fact, that "addSelectionInterval" does not change any other selection. To override the current selection, please use "setSelctionInterval" or for a single entry use "setSelectedIndex".
Parameters:
{int} | iFromIndex | The starting index of the range which will be selected. |
{int} | iToIndex | The starting index of the range which will be selected. |
Returns:
Attaches event handler
fnFunction
to the
toggleOpenState
event of this
sap.ui.table.TreeTable
.
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.table.TreeTable
itself.
fired when a node has been expanded or collapsed (only available in hierachical mode)
Parameters:
{object} | oData? | An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
{function} | fnFunction | The function to be called when the event occurs |
{object} | oListener? | Context object to call the event handler with. Defaults to this sap.ui.table.TreeTable itself |
Returns:
Clears the complete selection (all tree table rows/nodes will lose their selection)
Returns:
collapses the row for the given row index
Parameters:
{int} | iRowIndex | index of the row to collapse |
Returns:
Collapses all nodes (and lower if collapseRecursive is activated)
Returns:
Detaches event handler
fnFunction
from the
toggleOpenState
event of this
sap.ui.table.TreeTable
.
The passed function and listener object must match the ones used for event registration.
Parameters:
{function} | fnFunction | The function to be called, when the event occurs |
{object} | oListener | Context object on which the given function had to be called |
Returns:
expands the row for the given row index
Parameters:
{int} | iRowIndex | index of the row to expand |
Returns:
Expands all nodes starting from the root level to the given level 'iLevel'.
Only supported with ODataModel v2, when running in OperationMode.Client or OperationMode.Auto. Fully supported for sap.ui.model.ClientTreeBinding
, e.g. if you are using a sap.ui.model.json.JSONModel
.
Please also see sap.ui.model.odata.OperationMode
.
Parameters:
{int} | iLevel | the level to which the trees shall be expanded |
Returns:
Fires event
toggleOpenState
to attached listeners.
Expects the following event parameters:
rowIndex
of type int
index of the expanded/collapsed rowrowContext
of type object
binding context of the selected rowexpanded
of type boolean
flag whether the node has been expanded or collapsed
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
getCollapseRecursive(): boolean
Gets current value of property
collapseRecursive
.
Setting collapseRecursive to true means, that when collapsing a node all subsequent child nodes will also be collapsed. This property is only supported with sap.ui.model.odata.v2.ODataModel
Default value is true
.
Returns:
{boolean} | Value of property collapseRecursive |
getExpandFirstLevel(): boolean
Gets current value of property
expandFirstLevel
.
Flag to enable or disable expanding of first level.
Default value is false
.
Returns:
{boolean} | Value of property expandFirstLevel |
getGroupHeaderProperty(): string
Gets current value of property
groupHeaderProperty
.
The property name of the rows data which will be displayed as a group header if the group mode is enabled
Returns:
{string} | Value of property groupHeaderProperty |
getRootLevel(): int
Gets current value of property
rootLevel
.
The root level is the level of the topmost tree nodes, which will be used as an entry point for OData services. This property is only supported when the TreeTable uses an underlying odata services with hierarchy annotations. This property is only supported with sap.ui.model.odata.v2.ODataModel The hierarchy annotations may also be provided locally as a parameter for the ODataTreeBinding.
Default value is 0
.
Returns:
{int} | Value of property rootLevel |
getSelectedIndex(): int[]
Retrieves the lead selection index. The lead selection index is, among other things, used to determine the start/end of a selection range, when using Shift-Click to select multiple entries at once.
Returns:
{int[]} | an array containing all selected indices (ascending ordered integers) |
getSelectedIndices(): int[]
Returns an array containing the row indices of all selected tree nodes (ordered ascending).
Please be aware of the following: Due to performance/network traffic reasons, the getSelectedIndices function returns only all indices of actually selected rows/tree nodes. Unknown rows/nodes (as in "not yet loaded" to the client), will not be returned.
Returns:
{int[]} | an array containing all selected indices |
getUseGroupMode(): boolean
Gets current value of property
useGroupMode
.
If group mode is enable nodes with subitems are rendered as if they were group headers. This can be used to do the grouping for an OData service on the backend and visualize this in a table. This mode only makes sense if the tree has a depth of exacly 1 (group headers and entries)
Default value is false
.
Returns:
{boolean} | Value of property useGroupMode |
isExpanded(iRowIndex): boolean
Returns whether the row is expanded or collapsed.
Parameters:
{int} | iRowIndex | index of the row to check |
Returns:
{boolean} | true if the node at "iRowIndex" is expanded, false otherwise (meaning it is collapsed) |
isIndexSelected(iRowIndex): boolean
Checks if the row at the given index is selected.
Parameters:
{int} | iRowIndex | The row index for which the selection state should be retrieved |
Returns:
{boolean} | true if the index is selected, false otherwise |
All rows/tree nodes inside the range (including boundaries) will be deselected. Tree nodes are referenced with theit absolute row index inside the tree- Please be aware, that the absolute row index only applies to the the tree which is visualized by the TreeTable. Invisible nodes (collapsed child nodes) will not be regarded.
Parameters:
{int} | iFromIndex | The starting index of the range which will be deselected. |
{int} | iToIndex | The starting index of the range which will be deselected. |
Returns:
Selects all available nodes/rows.
Explanation of the SelectAll function and what to expect from its behavior: All rows/tree nodes locally stored on the client are selected. In addition all subsequent rows/tree nodes, which will be paged into view are also immediatly selected. However, due to obvious performance/network traffic reasons, the SelectAll function will NOT retrieve any data from the backend.
Returns:
Sets a new value for property
expandFirstLevel
.
Flag to enable or disable expanding of first level.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Parameters:
{boolean} | bExpandFirstLevel | New value for property expandFirstLevel |
Returns:
Setter for property
fixedRowCount
.
This property is not supportd for the TreeTable and will be ignored!
Default value is 0
Parameters:
{int} | iFixedRowCount | new value for property fixedRowCount |
Returns:
Sets a new value for property
groupHeaderProperty
.
The property name of the rows data which will be displayed as a group header if the group mode is enabled
When called with a value of null
or undefined
, the default value of the property will be restored.
Parameters:
{string} | sGroupHeaderProperty | New value for property groupHeaderProperty |
Returns:
Overriden from Table.js base class. In a TreeTable you can only select indices, which correspond to the currently visualized tree. Invisible tree nodes (e.g. collapsed child nodes) can not be selected via Index, because they do not correspond to a TreeTable row.
Parameters:
{int} | iRowIndex | The row index which will be selected (if existing) |
Returns:
Sets the selection of the TreeTable to the given range (including boundaries). Beware: The previous selection will be lost/overriden. If this is not wanted, please use "addSelectionInterval" and "removeSelectionIntervall".
Parameters:
{int} | iFromIndex | the start index of the selection range |
{int} | iToIndex | the end index of the selection range |
Returns:
setSelectionMode(sSelectionMode)
Sets the selection mode. The current selection is lost.
Parameters:
{string} | sSelectionMode | the selection mode, see sap.ui.table.SelectionMode |
Sets a new value for property
useGroupMode
.
If group mode is enable nodes with subitems are rendered as if they were group headers. This can be used to do the grouping for an OData service on the backend and visualize this in a table. This mode only makes sense if the tree has a depth of exacly 1 (group headers and entries)
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Parameters:
{boolean} | bUseGroupMode | New value for property useGroupMode |
Returns: