on 12-08-2017 3:19 AM
Hi experts, I have Select countrol for product. And bind a list of products to the items property. I want to have the feature that, when user open the select dropdown list all products are grouped into two categories (available and unavailable), and sorted by the name. So I have the folloing code:
this.byId('productSelect').getBindingInfo('items').sorter = new sap.ui.model.Sorter("", null, function(oContext) {
return oContext.getProperty("available") ?
{key: 'available', text: 'Available'} :
{key: 'unavailable', text: 'Unavailable'}
}, function(a, b) {
if (!a.available && b.available) {
return 1;
} else if (a.available && !b.available) {
return -1;
}
return a.productName.toLowerCase().localeCompare(b.productName.toLowerCase());
});
The sorting function worked and the products are sorted like I expected. But there's no group headers like sap.m.List in DemoKit. So I want to know does items in sap.m.Select support grouping? Thank you so much!
Hi Cong Wang,
According to standard FIORI Guidelines, you should not use grouping within your sap.m.select. But, you can use custom filters and grouping in your case.
Regards,
Arjun Biswas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
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.