Skip to Content
0
Feb 27, 2017 at 09:45 AM

sorting on more than one column in sap.m.table

313 Views

Hi all,

i have requirement to sort on more than one column in sap.m.table

is it possible to sort the content of a table first by column1, then by column 2,and so on?

i tried to send more than one path in sorter

var oSorter = new sap.ui.model.Sorter("ProductionOrder",false);

var oBinding = oTable.getBinding("items");

oBinding.sort(oSorter);

var oSorter1 = new sap.ui.model.Sorter("type",false);

oBinding.aSorters[1]= oSorter1;

var oSorter2 = new sap.ui.model.Sorter("unit",false);

oBinding.aSorters[2]= oSorter2;

var oSorter3 = new sap.ui.model.Sorter("qty",false);

oBinding.aSorters[3]= oSorter3;

var oSorter4 = new sap.ui.model.Sorter("quality",false);

oBinding.aSorters[4]= oSorter4;

thanks