Skip to Content

Grouping in the master list footer.

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>

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jan 29 at 09:51 AM

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

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 29 at 09:19 AM

    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);
    }
    
    Add comment
    10|10000 characters needed characters exceeded