Class sap.ui.layout.GridModule: sap/ui/layout/Grid
The Grid control is a layout which positions its child controls in a 12 column flow layout. Its children can be specified to take on a variable amount of columns depending on available screen size. With this control it is possible to achieve flexible layouts and line-breaks for extra large-, large-, medium- and small-sized screens, such as large desktop, desktop, tablet, and mobile. The Grid control's width can be percentage- or pixel-based and the spacing between its columns can be set to various pre-defined values.
Since: 1.15.0.
sClassName
and enriches it with the information contained in oClassInfo
.ariaLabelledBy
.ariaLabelledBy
. 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: 100%)
- vSpacing : float (default: 1)
- hSpacing : float (default: 1)
- position : sap.ui.layout.GridPosition (default: Left)
- defaultSpan : sap.ui.layout.GridSpan (default: XL3 L3 M6 S12)
- defaultIndent : sap.ui.layout.GridIndent (default: XL0 L0 M0 S0)
- containerQuery : boolean (default: false)
- Aggregations
- content : sap.ui.core.Control[] (default)
In addition, all settings applicable to the base type sap.ui.core.Control can be used as well.
{string} | sId? | id for the new control, generated automatically if no id is given |
{object} | mSettings? | initial settings for the new control |
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.
{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 |
{function} | Created class / constructor function |
{sap.ui.base.Metadata} | Metadata object describing this class |
ariaLabelledBy
. {string|sap.ui.core.Control} | vAriaLabelledBy | the ariaLabelledBy to add; if empty, nothing is inserted |
- Since:
- 1.38.32
{sap.ui.layout.Grid} | Reference to this in order to allow method chaining |
content
. {sap.ui.core.Control} | oContent | the content to add; if empty, nothing is inserted |
{sap.ui.layout.Grid} | Reference to this in order to allow method chaining |
content
. {sap.ui.layout.Grid} | Reference to this in order to allow method chaining |
ariaLabelledBy
. - Since:
- 1.38.32
{sap.ui.core.Control[]} |
containerQuery
. If true then not the media Query ( device screen size), but the size of the container surrounding the grid defines the current range (large, medium or small).
Default value is false
.
{boolean} | Value of property containerQuery |
content
. Controls that are placed into Grid layout.
{sap.ui.core.Control[]} |
defaultIndent
. Optional. Defines default for the whole Grid numbers of empty columns before the current span begins. It can be defined for large, medium and small screens. Allowed values are separated by space Letters L, M or S followed by number of columns from 0 to 11 that the container has to take, for example: "L2 M4 S6", "M11", "s10" or "l4 m4". Note that the parameters has to be provided in the order large medium small.
Default value is XL0 L0 M0 S0
.
{sap.ui.layout.GridIndent} | Value of property defaultIndent |
defaultSpan
. Optional. A string type that represents Grid's default span values for large, medium and small screens for the whole Grid. Allowed values are separated by space Letters L, M or S followed by number of columns from 1 to 12 that the container has to take, for example: "L2 M4 S6", "M12", "s10" or "l4 m4". Note that the parameters has to be provided in the order large medium small.
Default value is XL3 L3 M6 S12
.
{sap.ui.layout.GridSpan} | Value of property defaultSpan |
hSpacing
. Optional. Horizontal spacing between the content in the Grid. In rem, allowed values are 0, 0.5 , 1 or 2.
Default value is 1
.
{float} | Value of property hSpacing |
position
. Optional. Position of the Grid in the window or surrounding container. Possible values are "Center", "Left" and "Right".
Default value is Left
.
{sap.ui.layout.GridPosition} | Value of property position |
vSpacing
. Optional. Vertical spacing between the rows in the Grid. In rem, allowed values are 0, 0.5, 1 and 2.
Default value is 1
.
{float} | Value of property vSpacing |
width
. Optional. Width of the Grid. If not specified, then 100%.
Default value is 100%
.
{sap.ui.core.CSSSize} | Value of property width |
sap.ui.core.Control
in the aggregation content
. and returns its index if found or -1 otherwise. {sap.ui.core.Control} | oContent | The content whose index is looked for |
{int} | The index of the provided control in the aggregation if found, or -1 otherwise |
content
. {sap.ui.core.Control} | oContent | the content to insert; if empty, nothing is inserted |
{int} | iIndex | the 0 -based index the content should be inserted at; for a negative value of iIndex , the content is inserted at position 0; for a value greater than the current size of the aggregation, the content is inserted at the last position |
{sap.ui.layout.Grid} | Reference to this in order to allow method chaining |
ariaLabelledBy
. - Since:
- 1.38.32
{sap.ui.core.Control[]} | An array of the removed elements (might be empty) |
content
. Additionally, it unregisters them from the hosting UIArea.
{sap.ui.core.Control[]} | An array of the removed elements (might be empty) |
ariaLabelledBy
. {int|string|sap.ui.core.Control} | vAriaLabelledBy | The ariaLabelledByto be removed or its index or ID |
- Since:
- 1.38.32
{sap.ui.core.Control} | the removed ariaLabelledBy or null |
content
. {int|string|sap.ui.core.Control} | vContent | The contentto remove or its index or id |
{sap.ui.core.Control} | The removed content or null |
containerQuery
. If true then not the media Query ( device screen size), but the size of the container surrounding the grid defines the current range (large, medium or small).
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
{boolean} | bContainerQuery | New value for property containerQuery |
{sap.ui.layout.Grid} | Reference to this in order to allow method chaining |
defaultIndent
. Optional. Defines default for the whole Grid numbers of empty columns before the current span begins. It can be defined for large, medium and small screens. Allowed values are separated by space Letters L, M or S followed by number of columns from 0 to 11 that the container has to take, for example: "L2 M4 S6", "M11", "s10" or "l4 m4". Note that the parameters has to be provided in the order large medium small.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is XL0 L0 M0 S0
.
{sap.ui.layout.GridIndent} | sDefaultIndent | New value for property defaultIndent |
{sap.ui.layout.Grid} | Reference to this in order to allow method chaining |
defaultSpan
. Optional. A string type that represents Grid's default span values for large, medium and small screens for the whole Grid. Allowed values are separated by space Letters L, M or S followed by number of columns from 1 to 12 that the container has to take, for example: "L2 M4 S6", "M12", "s10" or "l4 m4". Note that the parameters has to be provided in the order large medium small.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is XL3 L3 M6 S12
.
{sap.ui.layout.GridSpan} | sDefaultSpan | New value for property defaultSpan |
{sap.ui.layout.Grid} | Reference to this in order to allow method chaining |
hSpacing
. Optional. Horizontal spacing between the content in the Grid. In rem, allowed values are 0, 0.5 , 1 or 2.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is 1
.
{float} | fHSpacing | New value for property hSpacing |
{sap.ui.layout.Grid} | Reference to this in order to allow method chaining |
position
. Optional. Position of the Grid in the window or surrounding container. Possible values are "Center", "Left" and "Right".
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Left
.
{sap.ui.layout.GridPosition} | sPosition | New value for property position |
{sap.ui.layout.Grid} | Reference to this in order to allow method chaining |
vSpacing
. Optional. Vertical spacing between the rows in the Grid. In rem, allowed values are 0, 0.5, 1 and 2.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is 1
.
{float} | fVSpacing | New value for property vSpacing |
{sap.ui.layout.Grid} | Reference to this in order to allow method chaining |
width
. Optional. Width of the Grid. If not specified, then 100%.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is 100%
.
{sap.ui.core.CSSSize} | sWidth | New value for property width |
{sap.ui.layout.Grid} | Reference to this in order to allow method chaining |