on 06-09-2022 6:48 PM
Hi experts,
I am just wondering if you know how to change the colour of the star/asterisk that comes with sap.m.label. I want to change only a certain amount of the asterisks so I am thinking of using custom data to differentiate them apart. But my issue is that how do I actually change the colour of the asterisk?
code for label:
<Label text="{i18n>title}" required="true">
<customData>
<core:CustomData key="CE" value="blue" writeToDom="true" />
</customData>
</Label>
corresponding ccs file:
[data-CE="blue"]{
color: blue !important;
}
However, that just changed the colour of the label text and not the asterisk
here is the screenshot of the inspecting element
I know the classes that asterisks are using: " .sapMLabel.sapMLabelRequired .sapMLabelColonAndRequired::after "
Does anyone know how can I apply the colour to the right place?
Thank you,
Buch
Got it working
using the id with addclass to the element
let languageLabel = this.getView().byId("languageLabel");
$($(languageLabel.getDomRef()).children()[1]).addClass("blue");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
8 | |
8 | |
8 | |
7 | |
6 | |
5 | |
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.