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

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

Add comment
10|10000 characters needed characters exceeded

  • While i see nothing much wrong with your approach barring more careful observation towards the syntactical constructs. But this sort has to be handled on the server . You can pass the multiple sorters and and they will also be received on the server, but your OData services need to react to these parameters and sort the results in the right way.

  • Get RSS Feed

1 Answer

Skip to Content