Skip to Content
0
Former Member
Nov 07, 2016 at 11:03 AM

Filter table doesn't work

295 Views Last edit May 27, 2020 at 08:27 AM 2 rev

Hello everyone!

I have one problem with Filter table. Grouping is working but Ascending und Descending don't work....I cannot understand why...

f4.png

This is my code.

    handleConfirm: function(oEvent) {
        var oView = this.getView();
        var oTable = oView.byId("idStats");

        var mParams = oEvent.getParameters();
        var oBinding = oTable.getBinding("items");

        // apply sorter to binding
        // (grouping comes before sorting)
        var aSorters = [];

        if (mParams.groupItem) {
            var sPath = mParams.groupItem.getKey();
            var bDescending = mParams.groupDescending;
            var vGroup = this.mGroupFunctions[sPath];
            aSorters.push(new sap.ui.model.Sorter(sPath, bDescending, vGroup));
        }
        var sPath = mParams.sortItem.getKey();
        var bDescending = mParams.sortDescending;
        aSorters.push(new sap.ui.model.Sorter(sPath, bDescending));
        oBinding.sort(aSorters);
    },

Attachments

f4.png (49.3 kB)