Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Get Active Span in GridData


I want to create a situation where the Text Alignment  of my label is based on the current Span setting of the component. My label is defined as follows:

var label = new sap.m.Label({

     text: "test",

     textAlign: sap.ui.core.TextAlign.Right,

     layoutData: new sap.ui.layout.GridData({

          span: "L1 M1 S12"



Now if the label is set to display using the S12 span (based on the current screen size), then I would like to use:

label.setProperty("textAlign", sap.ui.core.TextAlign.Center)

Is it possible to get the current Span setting being applied to the label?


Former Member

Helpful Answer

Not what you were looking for? View more on this topic or Ask a question