on 08-24-2021 7:33 PM
Hey everyone,
I am trying to set class in the comboBox
let oComboOperator = new sap.m.ComboBox(this.getView().createId("comboAddOperator" + this.countFilter), {
items: {
path: operatorName + ">/",
sorter: { path: "operator" },
template: new sap.ui.core.Item({
key: "{" + operatorName + ">key}",
text: "{" + operatorName + ">operator}"
})
},
placeholder: "Enter Operator",
class: "sapUiSmallMarginEnd"
});
However, it does not work. The error is
Assertion failed: ManagedObject.apply: encountered unknown setting 'class' for class 'sap.m.ComboBox' (value:'sapUiSmallMarginEnd')
Anyone knows what I did wrong here?
Thanks in advance
Buch
Hi buch,
class is a reserved keyword in JS. That's why it is giving an error on it. To apply CSS class in SAPUI5, please use addStyleClass method in the control.
let oComboOperator =newsap.m.ComboBox(this.getView().createId("comboAddOperator" + this.countFilter), {
items:{
path: operatorName +">/",
sorter:{ path:"operator" },
template:newsap.ui.core.Item({key:"{" + operatorName + ">key}",text:"{" + operatorName + ">operator}"})},
placeholder:"Enter Operator"}).addStyleClass("sapUiSmallMarginEnd");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
11 | |
10 | |
8 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.