Class sap.ui.model.TreeBindingModule: sap/ui/model/TreeBinding

extends Binding
known direct subclasses: AnalyticalBinding, ODataTreeBinding

The TreeBinding is a specific binding for trees in the model, which can be used to populate Trees.

Constructor Summary
new sap.ui.model.TreeBinding(oModel, sPath, oContext?, aFilters?, mParameters?, aSorters?)Constructor for TreeBinding
Method Summary
sap.ui.model.TreeBinding.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.model.TreeBinding with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.model.TreeBinding.getMetadata()Returns a metadata object for class sap.ui.model.TreeBinding.
filter(aFilters, sFilterType)Filters the tree according to the filter definitions.
getChildCount(oContext)Returns the number of child nodes of a specific context
getNodeContexts(oContext, iStartIndex, iLength)Returns the current value of the bound target
getRootContexts(iStartIndex, iLength)Returns the current value of the bound target
hasChildren(oContext)Returns if the node has child nodes
sort(aSorters)Sorts the tree according to the sorter definitions.
attachFilter(fnFunction, oListener?)Attach event-handler fnFunction to the '_filter' event of this sap.ui.model.TreeBinding.
detachFilter(fnFunction, oListener?)Detach event-handler fnFunction from the '_filter' event of this sap.ui.model.TreeBinding.
Methods borrowed from class sap.ui.base.Object
Constructor Detail
new sap.ui.model.TreeBinding(oModel, sPath, oContext?, aFilters?, mParameters?, aSorters?)
Constructor for TreeBinding
Parameters:
{sap.ui.model.Model}oModel
{string}sPath the path pointing to the tree / array that should be bound
{object}oContext? the context object for this databinding (optional)
{array}aFilters? predefined filter/s contained in an array (optional)
{object}mParameters? additional model specific parameters (optional)
{array}aSorters? predefined sap.ui.model.sorter/s contained in an array (optional)
Method Detail
sap.ui.model.TreeBinding.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.model.TreeBinding 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.Binding.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
sap.ui.model.TreeBinding.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.model.TreeBinding.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
filter(aFilters, sFilterType)
Filters the tree according to the filter definitions.
Parameters:
{sap.ui.model.Filter[]}aFilters Array of sap.ui.model.Filter objects
{sap.ui.model.FilterType}sFilterType Type of the filter which should be adjusted, if it is not given, the standard behaviour applies
getChildCount(oContext): int
Returns the number of child nodes of a specific context
Parameters:
{Object}oContext the context element of the node
Returns:
{int} the number of children
getNodeContexts(oContext, iStartIndex, iLength): Array
Returns the current value of the bound target
Parameters:
{Object}oContext the context element of the node
{int}iStartIndex the startIndex where to start the retrieval of contexts
{int}iLength determines how many contexts to retrieve beginning from the start index.
Returns:
{Array} the array of child contexts for the given node
getRootContexts(iStartIndex, iLength): Array
Returns the current value of the bound target
Parameters:
{int}iStartIndex the startIndex where to start the retrieval of contexts
{int}iLength determines how many contexts to retrieve beginning from the start index.
Returns:
{Array} the array of child contexts for the root node
hasChildren(oContext): boolean
Returns if the node has child nodes
Parameters:
{Object}oContext the context element of the node
Returns:
{boolean} true if node has children
sort(aSorters)
Sorts the tree according to the sorter definitions.
Parameters:
{sap.ui.model.Sorter[]}aSorters Array of sap.ui.model.Sorter objects
attachFilter(fnFunction, oListener?)
Attach event-handler fnFunction to the '_filter' event of this sap.ui.model.TreeBinding.
Parameters:
{function}fnFunction The function to call, when the event occurs.
{object}oListener? object on which to call the given function.
Deprecated:
use the change event. It now contains a parameter (reason : "filter") when a filter event is fired.
detachFilter(fnFunction, oListener?)
Detach event-handler fnFunction from the '_filter' event of this sap.ui.model.TreeBinding.
Parameters:
{function}fnFunction The function to call, when the event occurs.
{object}oListener? object on which to call the given function.
Deprecated:
use the change event.