Class sap.ui.commons.layout.MatrixLayoutModule: sap/ui/commons/layout/MatrixLayout

extends Control

A matrix layout arranges controls in a grid structure, using rows which need not have the same number of cells.

It uses predefined cell classes that guarantee appropriate distances between cells in the grid. The cell's vGutter property lets you specify additional horizontal distances easily. You can set these additional distances (known as gutters) with or without separators. The distance for each cell is specified by assigning a specific enumeration value of the class LayoutCellSeparator of the matrix data object.

You should avoid nesting matrix layouts. You should only use a matrix layout if you need to align controls horizontally across rows.

Deprecated API:
Since version 1.38. Instead, use the sap.ui.layout.Grid control.
Constructor Summary
new sap.ui.commons.layout.MatrixLayout(sId?, mSettings?)Constructor for a new layout/MatrixLayout.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.commons.layout.MatrixLayout.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.commons.layout.MatrixLayout with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.commons.layout.MatrixLayout.getMetadata()Returns a metadata object for class sap.ui.commons.layout.MatrixLayout.
addRow(oRow)Adds some row to the aggregation rows.
createRow(rowContent)Creates a new matrix layout row and appends it to this matrix layout.
destroyRows()Destroys all the rows in the aggregation rows.
getColumns()Gets current value of property columns.
getHeight()Gets current value of property height.
getLayoutFixed()Gets current value of property layoutFixed.
getRows()Gets content of aggregation rows.
getWidth()Gets current value of property width.
getWidths()Gets current value of property widths.
indexOfRow(oRow)Checks for the provided sap.ui.commons.layout.MatrixLayoutRow in the aggregation rows.
insertRow(oRow, iIndex)Inserts a row into the aggregation rows.
removeAllRows()Removes all the controls from the aggregation rows.
removeRow(vRow)Removes a row from the aggregation rows.
setColumns(iColumns)Sets a new value for property columns.
setHeight(sHeight)Sets a new value for property height.
setLayoutFixed(bLayoutFixed)Sets a new value for property layoutFixed.
setWidth(sWidth)Sets a new value for property width.
setWidths(sWidths)Sets a new value for property widths.
Constructor Detail
new sap.ui.commons.layout.MatrixLayout(sId?, mSettings?)

Constructor for a new layout/MatrixLayout.

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

    • rows : sap.ui.commons.layout.MatrixLayoutRow[] (default)

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

Parameters:
stringsId?id for the new control, generated automatically if no id is given
objectmSettings?initial settings for the new control
Method Detail
sap.ui.commons.layout.MatrixLayout.extend(sClassName, oClassInfo?, FNMetaImpl?): function

Creates a new subclass of class sap.ui.commons.layout.MatrixLayout 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:
stringsClassNameName of the class being created
objectoClassInfo?Object literal with information about the class
functionFNMetaImpl?Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
functionCreated class / constructor function
sap.ui.commons.layout.MatrixLayout.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.commons.layout.MatrixLayout.
Returns:
sap.ui.base.MetadataMetadata object describing this class
Adds some row to the aggregation rows.
Parameters:
sap.ui.commons.layout.MatrixLayoutRowoRowthe row to add; if empty, nothing is inserted
Returns:
sap.ui.commons.layout.MatrixLayoutReference to this in order to allow method chaining
createRow(rowContent): sap.ui.commons.layout.MatrixLayout

Creates a new matrix layout row and appends it to this matrix layout.

Each argument must be either a matrix layout cell, which is added to the row "as is", or an arbitrary content control, which is wrapped with a new (default) matrix layout cell first and then added to the row.

Parameters:
sap.ui.core.Control|sap.ui.commons.layout.MatrixLayoutCell|stringrowContentto add
Returns:
sap.ui.commons.layout.MatrixLayoutthis to allow method chaining
Destroys all the rows in the aggregation rows.
Returns:
sap.ui.commons.layout.MatrixLayoutReference to this in order to allow method chaining
getColumns(): int

Gets current value of property columns.

Number of columns. If not specified, the number of columns will be determined from the given cells.

Returns:
intValue of property columns
getHeight(): sap.ui.core.CSSSize

Gets current value of property height.

CSS height of the matrix layout.

Returns:
sap.ui.core.CSSSizeValue of property height
getLayoutFixed(): boolean

Gets current value of property layoutFixed.

Sets the table layout. If fixed the width parameter of a column has priority, if not the width of the content of the colums has priority. The default is "fixed". If the fixed layout is used an adequate width of the MatrixLayout should be provided. Otherwise the column width displayed could be different than the given ones because of browser dependend optimazations.

Default value is true.

Returns:
booleanValue of property layoutFixed

Gets content of aggregation rows.

The matrix layout's individual rows.

Returns:
sap.ui.commons.layout.MatrixLayoutRow[]
getWidth(): sap.ui.core.CSSSize

Gets current value of property width.

CSS width of the matrix layout. If the LayoutFixed = true an adequate width should be provided.

Returns:
sap.ui.core.CSSSizeValue of property width
getWidths(): sap.ui.core.CSSSize[]

Gets current value of property widths.

Widths of the columns. Use an array to define the widths of the columns. If a column shall have an automatical sizing enter "auto" for this column width.

Returns:
sap.ui.core.CSSSize[]Value of property widths
indexOfRow(oRow): int
Checks for the provided sap.ui.commons.layout.MatrixLayoutRow in the aggregation rows. and returns its index if found or -1 otherwise.
Parameters:
sap.ui.commons.layout.MatrixLayoutRowoRowThe row whose index is looked for
Returns:
intThe index of the provided control in the aggregation if found, or -1 otherwise
insertRow(oRow, iIndex): sap.ui.commons.layout.MatrixLayout
Inserts a row into the aggregation rows.
Parameters:
sap.ui.commons.layout.MatrixLayoutRowoRowthe row to insert; if empty, nothing is inserted
intiIndexthe 0-based index the row should be inserted at; for a negative value of iIndex, the row is inserted at position 0; for a value greater than the current size of the aggregation, the row is inserted at the last position
Returns:
sap.ui.commons.layout.MatrixLayoutReference to this in order to allow method chaining

Removes all the controls from the aggregation rows.

Additionally, it unregisters them from the hosting UIArea.

Returns:
sap.ui.commons.layout.MatrixLayoutRow[]An array of the removed elements (might be empty)
Removes a row from the aggregation rows.
Parameters:
int|string|sap.ui.commons.layout.MatrixLayoutRowvRowThe row to remove or its index or id
Returns:
sap.ui.commons.layout.MatrixLayoutRowThe removed row or null
setColumns(iColumns): sap.ui.commons.layout.MatrixLayout

Sets a new value for property columns.

Number of columns. If not specified, the number of columns will be determined from the given cells.

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

Parameters:
intiColumnsNew value for property columns
Returns:
sap.ui.commons.layout.MatrixLayoutReference to this in order to allow method chaining

Sets a new value for property height.

CSS height of the matrix layout.

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

Parameters:
sap.ui.core.CSSSizesHeightNew value for property height
Returns:
sap.ui.commons.layout.MatrixLayoutReference to this in order to allow method chaining
setLayoutFixed(bLayoutFixed): sap.ui.commons.layout.MatrixLayout

Sets a new value for property layoutFixed.

Sets the table layout. If fixed the width parameter of a column has priority, if not the width of the content of the colums has priority. The default is "fixed". If the fixed layout is used an adequate width of the MatrixLayout should be provided. Otherwise the column width displayed could be different than the given ones because of browser dependend optimazations.

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

Default value is true.

Parameters:
booleanbLayoutFixedNew value for property layoutFixed
Returns:
sap.ui.commons.layout.MatrixLayoutReference to this in order to allow method chaining

Sets a new value for property width.

CSS width of the matrix layout. If the LayoutFixed = true an adequate width should be provided.

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

Parameters:
sap.ui.core.CSSSizesWidthNew value for property width
Returns:
sap.ui.commons.layout.MatrixLayoutReference to this in order to allow method chaining

Sets a new value for property widths.

Widths of the columns. Use an array to define the widths of the columns. If a column shall have an automatical sizing enter "auto" for this column width.

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

Parameters:
sap.ui.core.CSSSize[]sWidthsNew value for property widths
Returns:
sap.ui.commons.layout.MatrixLayoutReference to this in order to allow method chaining