Skip to Content
0

Grouping in the master list footer.

Jan 29 at 08:45 AM

16

avatar image

Good morning everyone.

This is my Challenge. I would like to group by Customer Name and Amount in the in the master list footer.

Please can someone help me with a function that I can use in the Master Control.

For that I used the Option “Select”.

<Select

id="groupSelect"

change=

icon="sap-icon://group-2"

type="IconOnly"

selectedKey="None"

autoAdjustWidth="true" >

<core:Item

key="GroupByCompanyName"

text="{i18n>MasterGroupCustomer}"/>

<core:Item

key="GroupByNetAmount"

text="{i18n>MasterGroupAmount}"/>

<core:Item

key="GroupByLifecycleStatus"

text="{i18n>MasterGroupStatus}"/>

</Select>

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Eric Ntomo Jan 29 at 09:51 AM
0

Hi Efim, I thank you for your suggestion. I will be trying and let you know

Share
10 |10000 characters needed characters left characters exceeded
Efim Parshin Jan 29 at 09:19 AM
0

Hi!

First of all, you can use "forceSelection = false" flag for your Select control, instead of selectedKey="None".

Then you should change item keys, according to properties that your master list is binded to.

For Example, your master list model has an array of properties [{CompanyName: 'Best Company ever', NetAmount: 9999}, ...], so you change keys of Select like this GroupByCompanyName -> CompanyName, GroupByNetAmount -> NetAmount.

So change handler will be somethig like this:

onGroupSelectChange: function (oEvent) {
    var oItem = oEvent.getParameter('selectedItem');
    var sKey = oItem.getKey();
    var oSorter = new sap.ui.model.Sorter(sKey, true, true);

    var oMasterList = this.byId('YourMasterListId');
    
    oMasterList.getBinding('items').sort(oSorter);
}
Share
10 |10000 characters needed characters left characters exceeded