Class sap.m.ViewSettingsItemModule: sap/m/ViewSettingsItem

extends Item

ViewSettingsItem is used for modelling filter behaviour in the ViewSettingsDialog. It is derived from a core Item, but does not support the base class properties "textDirection" and "enabled", setting these properties will not have any effects. Apps should use the core Item's property key/ and provide a unique value for it. Not providing a key may lead to unexpected behavior of the sap.m.ViewSettingsDialog.


Since: 1.16.
Constructor Summary
new sap.m.ViewSettingsItem(sId?, mSettings?)Constructor for a new ViewSettingsItem.
Event Summary
itemPropertyChanged(oControlEvent)Let the outside world know that some of its properties has changed.
Method Summary
sap.m.ViewSettingsItem.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.m.ViewSettingsItem with name sClassName and enriches it with the information contained in oClassInfo.
sap.m.ViewSettingsItem.getMetadata()Returns a metadata object for class sap.m.ViewSettingsItem.
attachItemPropertyChanged(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the itemPropertyChanged event of this sap.m.ViewSettingsItem.
detachItemPropertyChanged(fnFunction, oListener)Detaches event handler fnFunction from the itemPropertyChanged event of this sap.m.ViewSettingsItem.
fireItemPropertyChanged(mArguments?)Fires event itemPropertyChanged to attached listeners.
getSelected()Gets current value of property selected.
setSelected(bSelected)Sets a new value for property selected.
Constructor Detail
new sap.m.ViewSettingsItem(sId?, mSettings?)
Constructor for a new ViewSettingsItem.

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
  • Events
    • itemPropertyChanged : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]

In addition, all settings applicable to the base type sap.ui.core.Item 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
Event Detail
itemPropertyChanged(oControlEvent)
Let the outside world know that some of its properties has changed.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{sap.m.ViewSettingsItem}oControlEvent.getParameters.changedItem Instance of the item that changed.
{string}oControlEvent.getParameters.propertyKey Key of the changed property.
{mixed}oControlEvent.getParameters.propertyValue Value of the changed property.
Method Detail
sap.m.ViewSettingsItem.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.m.ViewSettingsItem 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.Item.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.m.ViewSettingsItem.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.ViewSettingsItem.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
attachItemPropertyChanged(oData?, fnFunction, oListener?): sap.m.ViewSettingsItem
Attaches event handler fnFunction to the itemPropertyChanged event of this sap.m.ViewSettingsItem.

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.m.ViewSettingsItem itself.

Let the outside world know that some of its properties has 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.m.ViewSettingsItem itself
Returns:
{sap.m.ViewSettingsItem} Reference to this in order to allow method chaining
detachItemPropertyChanged(fnFunction, oListener): sap.m.ViewSettingsItem
Detaches event handler fnFunction from the itemPropertyChanged event of this sap.m.ViewSettingsItem.

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.m.ViewSettingsItem} Reference to this in order to allow method chaining
fireItemPropertyChanged(mArguments?): sap.m.ViewSettingsItem
Fires event itemPropertyChanged to attached listeners.

Expects the following event parameters:

  • changedItem of type sap.m.ViewSettingsItemInstance of the item that changed.
  • propertyKey of type stringKey of the changed property.
  • propertyValue of type mixedValue of the changed property.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.m.ViewSettingsItem} Reference to this in order to allow method chaining
getSelected(): boolean
Gets current value of property selected.

Selected state of the item. If set to "true", the item will be displayed as selected in the view settings dialog.

Default value is false.

Returns:
{boolean} Value of property selected
setSelected(bSelected): sap.m.ViewSettingsItem
Sets a new value for property selected.

Selected state of the item. If set to "true", the item will be displayed as selected in the view settings dialog.

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

Default value is false.

Parameters:
{boolean}bSelected New value for property selected
Returns:
{sap.m.ViewSettingsItem} Reference to this in order to allow method chaining