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.
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
. 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
. 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
. addStyleClass,
allowTextSelection,
attachBrowserEvent,
attachValidateFieldGroup,
checkFieldGroupIds,
clone,
detachBrowserEvent,
detachValidateFieldGroup,
fireValidateFieldGroup,
getAccessibilityInfo,
getBusy,
getBusyIndicatorDelay,
getControlsByFieldGroupId,
getFieldGroupIds,
getIdForLabel,
getRenderer,
getVisible,
hasStyleClass,
invalidate,
isBusy,
onAfterRendering,
onBeforeRendering,
placeAt,
removeStyleClass,
rerender,
setBusy,
setBusyIndicatorDelay,
setFieldGroupIds,
setVisible,
toggleStyleClass,
triggerValidateFieldGroup $,
addCustomData,
addDependent,
addEventDelegate,
applyFocusInfo,
bindElement,
data,
destroy,
destroyCustomData,
destroyDependents,
destroyLayoutData,
destroyTooltip,
enhanceAccessibilityState,
exit,
findElements,
fireEvent,
focus,
getCustomData,
getDependents,
getDomRef,
getElementBinding,
getFocusDomRef,
getFocusInfo,
getInterface,
getLayoutData,
getMetadata,
getTooltip,
getTooltip_AsString,
getTooltip_Text,
indexOfCustomData,
indexOfDependent,
init,
insertCustomData,
insertDependent,
prop,
removeAllCustomData,
removeAllDependents,
removeCustomData,
removeDependent,
removeEventDelegate,
setLayoutData,
setTooltip,
toString,
unbindElement addAggregation,
addAssociation,
applySettings,
attachFormatError,
attachModelContextChange,
attachParseError,
attachValidationError,
attachValidationSuccess,
bindAggregation,
bindContext,
bindObject,
bindProperty,
destroyAggregation,
detachFormatError,
detachModelContextChange,
detachParseError,
detachValidationError,
detachValidationSuccess,
findAggregatedObjects,
fireFormatError,
fireModelContextChange,
fireParseError,
fireValidationError,
fireValidationSuccess,
getAggregation,
getAssociation,
getBinding,
getBindingContext,
getBindingInfo,
getBindingPath,
getEventingParent,
getId,
getModel,
getObjectBinding,
getOriginInfo,
getParent,
getProperty,
hasModel,
indexOfAggregation,
insertAggregation,
isBound,
isInvalidateSuppressed,
isTreeBinding,
propagateMessages,
removeAggregation,
removeAllAggregation,
removeAllAssociation,
removeAssociation,
setAggregation,
setAssociation,
setBindingContext,
setModel,
setProperty,
unbindAggregation,
unbindContext,
unbindObject,
unbindProperty,
validateAggregation,
validateProperty 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:
{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. Instead, use the
sap.ui.layout.Grid
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:
{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 |
Returns a metadata object for class sap.ui.commons.layout.MatrixLayout.
Returns:
Adds some row to the aggregation rows
.
Parameters:
Returns:
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:
Returns:
Destroys all the rows in the aggregation rows
.
Returns:
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:
{int} | Value of property columns |
Gets current value of property
height
.
CSS height of the matrix layout.
Returns:
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 a 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:
{boolean} | Value of property layoutFixed |
Gets content of aggregation
rows
.
The matrix layout's individual rows.
Returns:
Gets current value of property
width
.
CSS width of the matrix layout. If the LayoutFixed = true a adequate width should be provided.
Returns:
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:
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:
Returns:
{int} | The index of the provided control in the aggregation if found, or -1 otherwise |
Inserts a row into the aggregation rows
.
Parameters:
{sap.ui.commons.layout.MatrixLayoutRow} | oRow | the row to insert; if empty, nothing is inserted |
{int} | iIndex | the 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:
Removes all the controls from the aggregation
rows
.
Additionally, it unregisters them from the hosting UIArea.
Returns:
Removes a row from the aggregation rows
.
Parameters:
Returns:
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:
{int} | iColumns | New value for property columns |
Returns:
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:
Returns:
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 a 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:
{boolean} | bLayoutFixed | New value for property layoutFixed |
Returns:
Sets a new value for property
width
.
CSS width of the matrix layout. If the LayoutFixed = true a adequate width should be provided.
When called with a value of null
or undefined
, the default value of the property will be restored.
Parameters:
Returns:
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:
Returns: