Tree binding implementation for client models.
Please Note that a hierarchy's "state" (i.e. the information about expanded, collapsed, selected, and deselected nodes) may become inconsistent when the structure of the model data is changed at runtime. This is because each node is identified internally by its index position relative to its parent, plus its parent's ID. Therefore, inserting or removing a node in the model data will likely lead to a shift in the index positions of other nodes, causing them to lose their state and/or to gain the state of another node.
Creates a new ClientTreeBinding.
This constructor should only be called by subclasses or model implementations, not by application or control code. Such code should use Model#bindTree on the corresponding model implementation instead.
new sap.ui.model.ClientTreeBinding(oModel, sPath, oContext?, aApplicationFilters?, mParameters?, aSorters?)
Param | Type | Default Value | Description |
---|---|---|---|
oModel | sap.ui.model.Model | Model instance that this binding is created for and that it belongs to |
|
sPath | string | Binding path pointing to the tree / array that should be bound; syntax is defined by subclasses |
|
oContext? | sap.ui.model.Context | Context object for this binding, mandatory when when a relative binding path is given |
|
aApplicationFilters? | sap.ui.model.Filter sap.ui.model.Filter[] | Predefined application filter, either a single instance or an array |
|
mParameters? | object | Additional model specific parameters as defined by subclasses; this class does not introduce any own parameters |
|
aSorters? | sap.ui.model.Sorter[] | Predefined sorter/s contained in an array (optional) |
Method | Description |
---|---|
sap.ui.model.ClientTreeBinding.extend |
Creates a new subclass of class sap.ui.model.ClientTreeBinding with name
|
filter |
Filters the tree according to the filter definitions. The filtering is applied recursively through the tree. The parent nodes of filtered child nodes will also be displayed if they don't match the filter conditions. All filters belonging to a group (=have the same path) are ORed and after that the results of all groups are ANDed.
|
sap.ui.model.ClientTreeBinding.getMetadata |
Returns a metadata object for class sap.ui.model.ClientTreeBinding. |
getNodeContexts |
Return node contexts for the tree |
getRootContexts |
Return root contexts for the tree |
hasChildren |
Returns if the node has child nodes. |
sort |
Sorts the contexts of this ClientTreeBinding. The tree will be sorted level by level. So the nodes are NOT sorted absolute, but relative to their parent node, to keep the hierarchy untouched. |
Creates a new subclass of class sap.ui.model.ClientTreeBinding 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.model.TreeBinding.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 |
Filters the tree according to the filter definitions.
The filtering is applied recursively through the tree. The parent nodes of filtered child nodes will also be displayed if they don't match the filter conditions. All filters belonging to a group (=have the same path) are ORed and after that the results of all groups are ANDed.
References:
Param | Type | DefaultValue | Description |
---|---|---|---|
aFilters | sap.ui.model.Filter sap.ui.model.Filter[] |
Single filter object or an array of filter objects |
|
sFilterType | sap.ui.model.FilterType |
Type of the filter which should be adjusted, if it is not given, the standard behaviour applies |
Returns a metadata object for class sap.ui.model.ClientTreeBinding.
Return node contexts for the tree
Param | Type | DefaultValue | Description |
---|---|---|---|
oContext | sap.ui.model.Context |
to use for retrieving the node contexts |
|
iStartIndex | int |
the startIndex where to start the retrieval of contexts |
|
iLength | int |
determines how many contexts to retrieve beginning from the start index. |
Return root contexts for the tree
Param | Type | DefaultValue | Description |
---|---|---|---|
iStartIndex | int |
the startIndex where to start the retrieval of contexts |
|
iLength | int |
determines how many contexts to retrieve beginning from the start index. |
Returns if the node has child nodes.
Param | Type | DefaultValue | Description |
---|---|---|---|
oContext | object |
the context element of the node |
Sorts the contexts of this ClientTreeBinding. The tree will be sorted level by level. So the nodes are NOT sorted absolute, but relative to their parent node, to keep the hierarchy untouched.
Param | Type | DefaultValue | Description |
---|---|---|---|
aSorters | sap.ui.model.Sorter[] |
An array of Sorter instances which will be applied |