class sap.ui.unified.CalendarLegend

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/unified/CalendarLegend
Application Component: CA-UI5-CTR

A legend for the Calendar Control. Displays special dates colors with their corresponding description. The aggregation specialDates can be set herefor.


Constructor

Constructor for a new CalendarLegend.

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

new sap.ui.unified.CalendarLegend(sId?, mSettings?)
Param Type Default Value Description
sId? string

id for the new control, generated automatically if no id is given

mSettings? object

initial settings for the new control


Properties

Name Type Default Value Description
columnWidth sap.ui.core.CSSSize 120px

Defines the width of the created columns in which the items are arranged.

Visibility: public
standardItems string[] Today, Selected, WorkingDay, NonWorkingDay

Determines the standard items related to the calendar days, such as, today, selected, working and non-working. Values must be one of sap.ui.unified.StandardCalendarLegendItem. Note: for versions 1.50 and 1.52, this property was defined in the subclass sap.m.PlanningCalendarLegend

Since: 1.54.

Visibility: public

Aggregations

Default Aggregation:

Name Cardinality Type Description
_standardItems 0..n sap.ui.unified.CalendarLegendItem
items 0..n sap.ui.unified.CalendarLegendItem

Items to be displayed.


Methods Overview

Method Description
addItem

Adds some item to the aggregation items.

destroyItems

Destroys all the items in the aggregation items.

sap.ui.unified.CalendarLegend.extend

Creates a new subclass of class sap.ui.unified.CalendarLegend 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.

getColumnWidth

Gets current value of property columnWidth.

Defines the width of the created columns in which the items are arranged.

Default value is '120px'.

getItems

Gets content of aggregation items.

Items to be displayed.

sap.ui.unified.CalendarLegend.getMetadata

Returns a metadata object for class sap.ui.unified.CalendarLegend.

getStandardItems

Gets current value of property standardItems.

Determines the standard items related to the calendar days, such as, today, selected, working and non-working. Values must be one of sap.ui.unified.StandardCalendarLegendItem. Note: for versions 1.50 and 1.52, this property was defined in the subclass sap.m.PlanningCalendarLegend

Default value is ['Today', 'Selected', 'WorkingDay', 'NonWorkingDay'].

indexOfItem

Checks for the provided sap.ui.unified.CalendarLegendItem in the aggregation items. and returns its index if found or -1 otherwise.

insertItem

Inserts a item into the aggregation items.

removeAllItems

Removes all the controls from the aggregation items.

Additionally, it unregisters them from the hosting UIArea.

removeItem

Removes a item from the aggregation items.

setColumnWidth

Sets a new value for property columnWidth.

Defines the width of the created columns in which the items are arranged.

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

Default value is '120px'.

setStandardItems

Sets a new value for property standardItems.

Determines the standard items related to the calendar days, such as, today, selected, working and non-working. Values must be one of sap.ui.unified.StandardCalendarLegendItem. Note: for versions 1.50 and 1.52, this property was defined in the subclass sap.m.PlanningCalendarLegend

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

Default value is ['Today', 'Selected', 'WorkingDay', 'NonWorkingDay'].

addItem

Adds some item to the aggregation items.

Param Type DefaultValue Description
oItem sap.ui.unified.CalendarLegendItem

The item to add; if empty, nothing is inserted

destroyItems

Destroys all the items in the aggregation items.

sap.ui.unified.CalendarLegend.extend

Creates a new subclass of class sap.ui.unified.CalendarLegend 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.

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

getColumnWidth

Gets current value of property columnWidth.

Defines the width of the created columns in which the items are arranged.

Default value is '120px'.

getItems

Gets content of aggregation items.

Items to be displayed.

sap.ui.unified.CalendarLegend.getMetadata

Returns a metadata object for class sap.ui.unified.CalendarLegend.

getStandardItems

Gets current value of property standardItems.

Determines the standard items related to the calendar days, such as, today, selected, working and non-working. Values must be one of sap.ui.unified.StandardCalendarLegendItem. Note: for versions 1.50 and 1.52, this property was defined in the subclass sap.m.PlanningCalendarLegend

Default value is ['Today', 'Selected', 'WorkingDay', 'NonWorkingDay'].

indexOfItem

Checks for the provided sap.ui.unified.CalendarLegendItem in the aggregation items. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
oItem sap.ui.unified.CalendarLegendItem

The item whose index is looked for

insertItem

Inserts a item into the aggregation items.

Param Type DefaultValue Description
oItem sap.ui.unified.CalendarLegendItem

The item to insert; if empty, nothing is inserted

iIndex int

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

removeAllItems

Removes all the controls from the aggregation items.

Additionally, it unregisters them from the hosting UIArea.

removeItem

Removes a item from the aggregation items.

Param Type DefaultValue Description
vItem int string sap.ui.unified.CalendarLegendItem

The item to remove or its index or id

setColumnWidth

Sets a new value for property columnWidth.

Defines the width of the created columns in which the items are arranged.

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

Default value is '120px'.

Param Type DefaultValue Description
sColumnWidth sap.ui.core.CSSSize '120px'

New value for property columnWidth

setStandardItems

Sets a new value for property standardItems.

Determines the standard items related to the calendar days, such as, today, selected, working and non-working. Values must be one of sap.ui.unified.StandardCalendarLegendItem. Note: for versions 1.50 and 1.52, this property was defined in the subclass sap.m.PlanningCalendarLegend

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

Default value is ['Today', 'Selected', 'WorkingDay', 'NonWorkingDay'].

Param Type DefaultValue Description
sStandardItems string[] ['Today', 'Selected', 'WorkingDay', 'NonWorkingDay']

New value for property standardItems