on 09-03-2020 10:07 PM
I'm unable to run a comparator function on a sap.m.ComboBox to do a case-insensitive sort. Is there a workaround here? Control looks like below.
If I do "control.getBinding("items").sort(new sap.ui.model.Sorter("name", true, true, comparingFn)" it doesnt run.
const sorterTest = new sap.ui.model.Sorter("name");
sortStrings = (a, b) => {
console.log({a, b})
a = a.toLowerCase();
b = b.toLowerCase();
if (a > b) {
return 1;
} else if (a < b) {
return -1;
} else if (a === b) {
return 0;
}
};
sorterTest.fnCompare = sortStrings;
const control = new sap.m.ComboBox(sId, {
items: {
path: "/path",
templateShareable: false,
template: new sap.m.,
sorter: [sorterText],
},
});
Is it because of a Typo: sorterText -> sorterTest ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.