/scripts/ahub.form.attachments.js
0

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

Feb 27, 2017 at 09:45 AM

60

avatar image

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

10 |10000 characters needed characters left 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.

0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
avatar image
Former Member Feb 27, 2017 at 03:50 PM
0
Share
10 |10000 characters needed characters left characters exceeded
Skip to Content