Skip to Content
avatar image
Former Member

Get Active Span in GridData

Hi,

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?

Regards

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Oct 26, 2015 at 10:34 AM

    Hi Albert,

    Will this help? http://jsbin.com/soyiye/edit?html,js,output

    Thanks,

    Karthik A

    Add comment
    10|10000 characters needed characters exceeded