Class sap.ui.ux3.DataSetModule: sap/ui/ux3/DataSet

extends Control

DataSet

Deprecated API:Since version 1.38.

Constructor Summary
new sap.ui.ux3.DataSet(sId?, mSettings?)Constructor for a new DataSet.
Event Summary
search(oControlEvent)Event which is fired when the user triggers a search
selectionChanged(oControlEvent)selection Changed
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.ux3.DataSet.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.ux3.DataSet with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.ux3.DataSet.getMetadata()Returns a metadata object for class sap.ui.ux3.DataSet.
_rerenderFilter()Rerendering of the FilterArea
_rerenderToolbar()Rerendering of the Toolbar
addFilter(oFilter)Adds some filter to the aggregation filter.
addItem(oItem)Adds some item to the aggregation items.
addToolbarItem(oOToolbarItem)add a toolbarItem to the toolbar
addView(oView)Adds some view to the aggregation views.
attachSearch(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the search event of this sap.ui.ux3.DataSet.
attachSelectionChanged(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the selectionChanged event of this sap.ui.ux3.DataSet.
bindItems(oBindingInfo)Binds aggregation items to model data.
clearSelection()clears dataset from all previous selections
createViewSwitch(oView, iIndex)Creates a view switch button
destroyFilter()Destroys all the filter in the aggregation filter.
destroyItems()Destroys all the items in the aggregation items.
destroyViews()Destroys all the views in the aggregation views.
detachSearch(fnFunction, oListener)Detaches event handler fnFunction from the search event of this sap.ui.ux3.DataSet.
detachSelectionChanged(fnFunction, oListener)Detaches event handler fnFunction from the selectionChanged event of this sap.ui.ux3.DataSet.
fireSearch(mArguments?)Fires event search to attached listeners.
fireSelectionChanged(mArguments?)Fires event selectionChanged to attached listeners.
getFilter()Gets content of aggregation filter.
getItems()Gets content of aggregation items.
getLeadSelection(sItemId)Returns the LeadSelection index
getMultiSelect()Gets current value of property multiSelect.
getSelectedIndex()use this function to retrieve the lead selected index
getSelectedIndices()use this function to retrieve all selected indices if multiple select is enabled
getSelectedItemId(iIndex)Returns id of selected Item from given index
getSelectedView()ID of the element which is the current target of the association selectedView, or null.
getShowFilter()Gets current value of property showFilter.
getShowSearchField()Gets current value of property showSearchField.
getShowToolbar()Gets current value of property showToolbar.
getViews()Gets content of aggregation views.
indexOfFilter(oFilter)Checks for the provided sap.ui.core.Control in the aggregation filter.
indexOfItem(oItem)Checks for the provided sap.ui.ux3.DataSetItem in the aggregation items.
indexOfView(oView)Checks for the provided sap.ui.ux3.DataSetView in the aggregation views.
insertFilter(oFilter, iIndex)Inserts a filter into the aggregation filter.
insertItem(oItem, iIndex)Inserts a item into the aggregation items.
insertView(oView, iIndex)Inserts a view into the aggregation views.
isSelectedIndex(iIndex)Returns true if iIndex is selected
removeAllFilter()Removes all the controls from the aggregation filter.
removeAllItems()Removes all the controls from the aggregation items.
removeAllViews()Removes all the controls from the aggregation views.
removeFilter(vFilter)Removes a filter from the aggregation filter.
removeItem(vItem)Removes a item from the aggregation items.
removeToolbarItem(oOToolbarItem)remove a toolbarItem to the toolbar
removeView(vView)Removes a view from the aggregation views.
setLeadSelection(iIIndex)Set the LeadSelection index
setMultiSelect(bMode)setter for multi selection mode
setSelectedView(oSelectedView)Sets the associated selectedView.
setShowFilter(bShowFilter)Sets a new value for property showFilter.
setShowSearchField(bShowSearchField)Sets a new value for property showSearchField.
setShowToolbar(bShowToolbar)Sets a new value for property showToolbar.
unbindItems()Unbinds aggregation items from model data.
Constructor Detail
new sap.ui.ux3.DataSet(sId?, mSettings?)
Constructor for a new DataSet.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject for a general description of the syntax of the settings object.

The supported settings are:

  • Properties
  • Aggregations
    • items : sap.ui.ux3.DataSetItem[]
    • views : sap.ui.ux3.DataSetView[]
    • filter : sap.ui.core.Control[]
  • Events
    • selectionChanged : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • search : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]

In addition, all settings applicable to the base type sap.ui.core.Control can be used as well.

Parameters:
{string}sId? id for the new control, generated automatically if no id is given
{object}mSettings? initial settings for the new control
Deprecated:
Since version 1.38.
Event Detail
search(oControlEvent)
Event which is fired when the user triggers a search
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{string}oControlEvent.getParameters.query The search query
selectionChanged(oControlEvent)
selection Changed
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{int}oControlEvent.getParameters.oldLeadSelectedIndex Old lead selected index
{int}oControlEvent.getParameters.newLeadSelectedIndex New lead selected index
Method Detail
sap.ui.ux3.DataSet.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.ux3.DataSet 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.

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.ux3.DataSet.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.ux3.DataSet.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
_rerenderFilter()
Rerendering of the FilterArea
_rerenderToolbar()
Rerendering of the Toolbar
addFilter(oFilter): sap.ui.ux3.DataSet
Adds some filter to the aggregation filter.
Parameters:
{sap.ui.core.Control}oFilter the filter to add; if empty, nothing is inserted
Returns:
{sap.ui.ux3.DataSet} Reference to this in order to allow method chaining
addItem(oItem): sap.ui.ux3.DataSet
Adds some item to the aggregation items.
Parameters:
{sap.ui.ux3.DataSetItem}oItem the item to add; if empty, nothing is inserted
Returns:
{sap.ui.ux3.DataSet} Reference to this in order to allow method chaining
addToolbarItem(oOToolbarItem): void
add a toolbarItem to the toolbar
Parameters:
{sap.ui.commons.ToolbarItem}oOToolbarItem ToolbarItem
addView(oView): sap.ui.ux3.DataSet
Adds some view to the aggregation views.
Parameters:
{sap.ui.ux3.DataSetView}oView the view to add; if empty, nothing is inserted
Returns:
{sap.ui.ux3.DataSet} Reference to this in order to allow method chaining
attachSearch(oData?, fnFunction, oListener?): sap.ui.ux3.DataSet
Attaches event handler fnFunction to the search event of this sap.ui.ux3.DataSet.

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.ux3.DataSet itself.

Event which is fired when the user triggers a search

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.ux3.DataSet itself
Returns:
{sap.ui.ux3.DataSet} Reference to this in order to allow method chaining
attachSelectionChanged(oData?, fnFunction, oListener?): sap.ui.ux3.DataSet
Attaches event handler fnFunction to the selectionChanged event of this sap.ui.ux3.DataSet.

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.ux3.DataSet itself.

selection Changed

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.ux3.DataSet itself
Returns:
{sap.ui.ux3.DataSet} Reference to this in order to allow method chaining
bindItems(oBindingInfo): sap.ui.ux3.DataSet
Binds aggregation items to model data.

See ManagedObject.bindAggregation for a detailed description of the possible properties of oBindingInfo.

Parameters:
{object}oBindingInfo The binding information
Returns:
{sap.ui.ux3.DataSet} Reference to this in order to allow method chaining
clearSelection()
clears dataset from all previous selections
createViewSwitch(oView, iIndex): object
Creates a view switch button
Parameters:
{object}oView View
{int}iIndex Index of view
Returns:
{object} viewSwitch instance
destroyFilter(): sap.ui.ux3.DataSet
Destroys all the filter in the aggregation filter.
Returns:
{sap.ui.ux3.DataSet} Reference to this in order to allow method chaining
destroyItems(): sap.ui.ux3.DataSet
Destroys all the items in the aggregation items.
Returns:
{sap.ui.ux3.DataSet} Reference to this in order to allow method chaining
destroyViews(): sap.ui.ux3.DataSet
Destroys all the views in the aggregation views.
Returns:
{sap.ui.ux3.DataSet} Reference to this in order to allow method chaining
detachSearch(fnFunction, oListener): sap.ui.ux3.DataSet
Detaches event handler fnFunction from the search event of this sap.ui.ux3.DataSet.

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:
{sap.ui.ux3.DataSet} Reference to this in order to allow method chaining
detachSelectionChanged(fnFunction, oListener): sap.ui.ux3.DataSet
Detaches event handler fnFunction from the selectionChanged event of this sap.ui.ux3.DataSet.

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:
{sap.ui.ux3.DataSet} Reference to this in order to allow method chaining
fireSearch(mArguments?): sap.ui.ux3.DataSet
Fires event search to attached listeners.

Expects the following event parameters:

  • query of type stringThe search query
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.ux3.DataSet} Reference to this in order to allow method chaining
fireSelectionChanged(mArguments?): sap.ui.ux3.DataSet
Fires event selectionChanged to attached listeners.

Expects the following event parameters:

  • oldLeadSelectedIndex of type intOld lead selected index
  • newLeadSelectedIndex of type intNew lead selected index
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.ux3.DataSet} Reference to this in order to allow method chaining
getFilter(): sap.ui.core.Control[]
Gets content of aggregation filter.

Filter control (e.g. a FacetFilter) for the DataSet

Returns:
{sap.ui.core.Control[]}
getItems(): sap.ui.ux3.DataSetItem[]
Gets content of aggregation items.

Aggregation of DataSetItems

Returns:
{sap.ui.ux3.DataSetItem[]}
getLeadSelection(sItemId): int
Returns the LeadSelection index
Parameters:
{string}sItemId Id of the selected DataSetItem
Returns:
{int} selected index
getMultiSelect(): boolean
Gets current value of property multiSelect.

Selection mode of the DataSet

Default value is false.

Returns:
{boolean} Value of property multiSelect
getSelectedIndex()
use this function to retrieve the lead selected index
getSelectedIndices()
use this function to retrieve all selected indices if multiple select is enabled
getSelectedItemId(iIndex): string
Returns id of selected Item from given index
Parameters:
{int}iIndex index of selection
Returns:
{string} id of selected item
getSelectedView(): sap.ui.ux3.DataSetView
ID of the element which is the current target of the association selectedView, or null.
Returns:
{sap.ui.ux3.DataSetView}
getShowFilter(): boolean
Gets current value of property showFilter.

show filter

Default value is true.

Returns:
{boolean} Value of property showFilter
getShowSearchField(): boolean
Gets current value of property showSearchField.

Show/hide SearchField in Toolbar

Default value is true.

Returns:
{boolean} Value of property showSearchField
getShowToolbar(): boolean
Gets current value of property showToolbar.

show Toolbar

Default value is true.

Returns:
{boolean} Value of property showToolbar
getViews(): sap.ui.ux3.DataSetView[]
Gets content of aggregation views.

views

Returns:
{sap.ui.ux3.DataSetView[]}
indexOfFilter(oFilter): int
Checks for the provided sap.ui.core.Control in the aggregation filter. and returns its index if found or -1 otherwise.
Parameters:
{sap.ui.core.Control}oFilter The filter whose index is looked for
Returns:
{int} The index of the provided control in the aggregation if found, or -1 otherwise
indexOfItem(oItem): int
Checks for the provided sap.ui.ux3.DataSetItem in the aggregation items. and returns its index if found or -1 otherwise.
Parameters:
{sap.ui.ux3.DataSetItem}oItem The item whose index is looked for
Returns:
{int} The index of the provided control in the aggregation if found, or -1 otherwise
indexOfView(oView): int
Checks for the provided sap.ui.ux3.DataSetView in the aggregation views. and returns its index if found or -1 otherwise.
Parameters:
{sap.ui.ux3.DataSetView}oView The view whose index is looked for
Returns:
{int} The index of the provided control in the aggregation if found, or -1 otherwise
insertFilter(oFilter, iIndex): sap.ui.ux3.DataSet
Inserts a filter into the aggregation filter.
Parameters:
{sap.ui.core.Control}oFilter the filter to insert; if empty, nothing is inserted
{int}iIndex the 0-based index the filter should be inserted at; for a negative value of iIndex, the filter is inserted at position 0; for a value greater than the current size of the aggregation, the filter is inserted at the last position
Returns:
{sap.ui.ux3.DataSet} Reference to this in order to allow method chaining
insertItem(oItem, iIndex): sap.ui.ux3.DataSet
Inserts a item into the aggregation items.
Parameters:
{sap.ui.ux3.DataSetItem}oItem the item to insert; if empty, nothing is inserted
{int}iIndex the 0-based index the item should be inserted at; for a negative value of iIndex, the item is inserted at position 0; for a value greater than the current size of the aggregation, the item is inserted at the last position
Returns:
{sap.ui.ux3.DataSet} Reference to this in order to allow method chaining
insertView(oView, iIndex): sap.ui.ux3.DataSet
Inserts a view into the aggregation views.
Parameters:
{sap.ui.ux3.DataSetView}oView the view to insert; if empty, nothing is inserted
{int}iIndex the 0-based index the view should be inserted at; for a negative value of iIndex, the view is inserted at position 0; for a value greater than the current size of the aggregation, the view is inserted at the last position
Returns:
{sap.ui.ux3.DataSet} Reference to this in order to allow method chaining
isSelectedIndex(iIndex): boolean
Returns true if iIndex is selected
Parameters:
{int}iIndex index of selection
Returns:
{boolean} index selected true/false
removeAllFilter(): sap.ui.core.Control[]
Removes all the controls from the aggregation filter.

Additionally, it unregisters them from the hosting UIArea.

Returns:
{sap.ui.core.Control[]} An array of the removed elements (might be empty)
removeAllItems(): sap.ui.ux3.DataSetItem[]
Removes all the controls from the aggregation items.

Additionally, it unregisters them from the hosting UIArea.

Returns:
{sap.ui.ux3.DataSetItem[]} An array of the removed elements (might be empty)
removeAllViews(): sap.ui.ux3.DataSetView[]
Removes all the controls from the aggregation views.

Additionally, it unregisters them from the hosting UIArea.

Returns:
{sap.ui.ux3.DataSetView[]} An array of the removed elements (might be empty)
removeFilter(vFilter): sap.ui.core.Control
Removes a filter from the aggregation filter.
Parameters:
{int|string|sap.ui.core.Control}vFilter The filterto remove or its index or id
Returns:
{sap.ui.core.Control} The removed filter or null
removeItem(vItem): sap.ui.ux3.DataSetItem
Removes a item from the aggregation items.
Parameters:
{int|string|sap.ui.ux3.DataSetItem}vItem The itemto remove or its index or id
Returns:
{sap.ui.ux3.DataSetItem} The removed item or null
removeToolbarItem(oOToolbarItem): void
remove a toolbarItem to the toolbar
Parameters:
{sap.ui.commons.ToolbarItem}oOToolbarItem
removeView(vView): sap.ui.ux3.DataSetView
Removes a view from the aggregation views.
Parameters:
{int|string|sap.ui.ux3.DataSetView}vView The viewto remove or its index or id
Returns:
{sap.ui.ux3.DataSetView} The removed view or null
setLeadSelection(iIIndex): void
Set the LeadSelection index
Parameters:
{int}iIIndex set LeadSelection index
setMultiSelect(bMode)
setter for multi selection mode
Parameters:
{boolean}bMode true for multi mode, false for single mode
setSelectedView(oSelectedView): sap.ui.ux3.DataSet
Sets the associated selectedView.
Parameters:
{sap.ui.ux3.DataSetView}oSelectedView Id of an element which becomes the new target of this selectedView association; alternatively, an element instance may be given
Returns:
{sap.ui.ux3.DataSet} Reference to this in order to allow method chaining
setShowFilter(bShowFilter): sap.ui.ux3.DataSet
Sets a new value for property showFilter.

show filter

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Parameters:
{boolean}bShowFilter New value for property showFilter
Returns:
{sap.ui.ux3.DataSet} Reference to this in order to allow method chaining
setShowSearchField(bShowSearchField): sap.ui.ux3.DataSet
Sets a new value for property showSearchField.

Show/hide SearchField in Toolbar

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Parameters:
{boolean}bShowSearchField New value for property showSearchField
Returns:
{sap.ui.ux3.DataSet} Reference to this in order to allow method chaining
setShowToolbar(bShowToolbar): sap.ui.ux3.DataSet
Sets a new value for property showToolbar.

show Toolbar

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Parameters:
{boolean}bShowToolbar New value for property showToolbar
Returns:
{sap.ui.ux3.DataSet} Reference to this in order to allow method chaining
unbindItems(): sap.ui.ux3.DataSet
Unbinds aggregation items from model data.
Returns:
{sap.ui.ux3.DataSet} Reference to this in order to allow method chaining