on 10-26-2015 9:55 AM
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thank you for your reply. Unfortunately I do not understand what the jsbin is supposed to show? The text says it will span 4 cols on large, 6 on medium and 12 on small, but the span is set to "L12 M12 S12" indicating that it will spand over 12 cols for all 3 screen sizes?
also My main problem is not that I can't set it to the span, my problem is that I want to dynamically find the current screen size that is being used. For example, if the current screen is seen as Large, then I want to set the Text alignment to Right, if the current screen is seen as Small, then I want to align the text to the left.
Regards
By Mistake I placed wrong one.
will this help? http://jsbin.com/dawapo/edit?js,output
Based on the screen size sap will add css classes automatically.
I appended my changes here.
Thanks,
Karthik A
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.