Class sap.gantt.legend.LegendContainerModule: sap/gantt/legend/LegendContainer

extends Control

The LegendContainer control uses the NavContainer control to handle hierarchical navigation between legend sections. The LegendContainer control contains an initial navigation page. Both the initial navigation page legend sections are Page controls.

Constructor Summary
new sap.gantt.legend.LegendContainer(sId?, mSettings?)Creates and initializes a new legend container.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.gantt.legend.LegendContainer.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.gantt.legend.LegendContainer with name sClassName and enriches it with the information contained in oClassInfo.
sap.gantt.legend.LegendContainer.getMetadata()Returns a metadata object for class sap.gantt.legend.LegendContainer.
addLegendSection(oLegendSection)Adds some legendSection to the aggregation legendSections.
destroyLegendSections()Destroys all the legendSections in the aggregation legendSections.
getCurrentLegendSection()Returns the currently displayed legend section.
getHeight()Gets current value of property height.
getLegendSections()Gets content of aggregation legendSections.
getNavigationItems()Returns the navigation items in the initial navigation list
getNavigationPage()Returns the control instance of List Control for the initial navigation page
getWidth()Gets current value of property width.
indexOfLegendSection(oLegendSection)Checks for the provided sap.m.Page in the aggregation legendSections.
insertLegendSection(oLegendSection, iIndex)Inserts a legendSection into the aggregation legendSections.
removeAllLegendSections()Removes all the controls from the aggregation legendSections.
removeLegendSection(vLegendSection)Removes a legendSection from the aggregation legendSections.
setHeight(sHeight)Sets a new value for property height.
setWidth(sWidth)Sets a new value for property width.
Constructor Detail
new sap.gantt.legend.LegendContainer(sId?, mSettings?)
Creates and initializes a new legend container.

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
    • width : sap.ui.core.CSSSize (default: 200px)
    • height : sap.ui.core.CSSSize (default: 200px)
  • Aggregations

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

Parameters:
{string}sId? ID of the new control, generated automatically if no ID is given
{object}mSettings? Initial settings for the new control
Method Detail
sap.gantt.legend.LegendContainer.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.gantt.legend.LegendContainer 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.gantt.legend.LegendContainer.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.gantt.legend.LegendContainer.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
addLegendSection(oLegendSection): sap.gantt.legend.LegendContainer
Adds some legendSection to the aggregation legendSections.
Parameters:
{sap.m.Page}oLegendSection the legendSection to add; if empty, nothing is inserted
Returns:
{sap.gantt.legend.LegendContainer} Reference to this in order to allow method chaining
destroyLegendSections(): sap.gantt.legend.LegendContainer
Destroys all the legendSections in the aggregation legendSections.
Returns:
{sap.gantt.legend.LegendContainer} Reference to this in order to allow method chaining
getCurrentLegendSection(): sap.m.Page
Returns the currently displayed legend section. If no legend section is added, this function returns the initial navigation page.
Returns:
{sap.m.Page} Control instance of the legend section
getHeight(): sap.ui.core.CSSSize
Gets current value of property height.

Height of the legend navigation. When the height specified is smaller than a section content, a vertical scroll bar appears.

Default value is 200px.

Returns:
{sap.ui.core.CSSSize} Value of property height
getLegendSections(): sap.m.Page[]
Gets content of aggregation legendSections.

This aggregation specifies the title of a legend section. When you add the legend section to a legend navigation container, you must specify a title for the legend section so that the section can be identified in the initial navigation list. Otherwise, your legend section is not reachable via GUI.

Returns:
{sap.m.Page[]}
getNavigationItems(): sap.m.StandardListItem
Returns the navigation items in the initial navigation list
Returns:
{sap.m.StandardListItem} Control instance of the initial page
getNavigationPage(): sap.m.Page
Returns the control instance of List Control for the initial navigation page
Returns:
{sap.m.Page} Control instance of the initial navigation page
getWidth(): sap.ui.core.CSSSize
Gets current value of property width.

Width of the legend navigation. When the width specified is smaller than a section content, a horizontal scroll bar appears.width of the legend navigation. When the width specified is smaller than a section content, a horizontal scroll bar appears.

Default value is 200px.

Returns:
{sap.ui.core.CSSSize} Value of property width
indexOfLegendSection(oLegendSection): int
Checks for the provided sap.m.Page in the aggregation legendSections. and returns its index if found or -1 otherwise.
Parameters:
{sap.m.Page}oLegendSection The legendSection whose index is looked for
Returns:
{int} The index of the provided control in the aggregation if found, or -1 otherwise
insertLegendSection(oLegendSection, iIndex): sap.gantt.legend.LegendContainer
Inserts a legendSection into the aggregation legendSections.
Parameters:
{sap.m.Page}oLegendSection the legendSection to insert; if empty, nothing is inserted
{int}iIndex the 0-based index the legendSection should be inserted at; for a negative value of iIndex, the legendSection is inserted at position 0; for a value greater than the current size of the aggregation, the legendSection is inserted at the last position
Returns:
{sap.gantt.legend.LegendContainer} Reference to this in order to allow method chaining
removeAllLegendSections(): sap.m.Page[]
Removes all the controls from the aggregation legendSections.

Additionally, it unregisters them from the hosting UIArea.

Returns:
{sap.m.Page[]} An array of the removed elements (might be empty)
removeLegendSection(vLegendSection): sap.m.Page
Removes a legendSection from the aggregation legendSections.
Parameters:
{int|string|sap.m.Page}vLegendSection The legendSectionto remove or its index or id
Returns:
{sap.m.Page} The removed legendSection or null
Sets a new value for property height.

Height of the legend navigation. When the height specified is smaller than a section content, a vertical scroll bar appears.

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

Default value is 200px.

Parameters:
{sap.ui.core.CSSSize}sHeight New value for property height
Returns:
{sap.gantt.legend.LegendContainer} Reference to this in order to allow method chaining
Sets a new value for property width.

Width of the legend navigation. When the width specified is smaller than a section content, a horizontal scroll bar appears.width of the legend navigation. When the width specified is smaller than a section content, a horizontal scroll bar appears.

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

Default value is 200px.

Parameters:
{sap.ui.core.CSSSize}sWidth New value for property width
Returns:
{sap.gantt.legend.LegendContainer} Reference to this in order to allow method chaining