Skip to Content
0

using web ide's list report template to achieve m.table odata sorting?

Jul 25 at 09:28 AM

14

avatar image

Hi,

I created a list report template and import the odata in the controller.js:

onInit: function() {

this.oModel = new sap.ui.model.odata.v2.ODataModel("/RCC/RCCODataService.svc/"); this.oModel.setUseBatch(false); this.getView().setModel(this.oModel);

...}

then I can do the filtering successfully like this:

...

var oList = this.getView().byId("idProductsTable");

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

oBinding.filter(aFilter);

the table will show the filtering items which I need.

the filter url is this:https://webidetesting.........sap.hana.ondemand.com/RCC/RCCODataService.svc/ReqCollections?$skip=0&$top=100&$filter=ProductCategory%20eq%20%27e%27

but when I want to sort the table, using the similar code:

var oCateSorter = new sap.ui.model.Sorter("ProductCategory", true);

......

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

oListBinding.sort(oCateSorter);

the URL is similar with the first URL:

https://webidetesting.........sap.hana.ondemand.com/RCC/RCCODataService.svc/ReqCollections?$skip=0&$top=100&$orderby=Submitter%20desc

the status code is 200 OK but the order is not work, so I just enter this URL to the browser, I find that the odata doesn't order by the submitter,too

But what makes me confused is that our odata url:

https:/.......cfapps.sap.hana.ondemand.com/RCCODataService.svc/ReqCollections?$skip=0&$top=100&$orderby=Submitter%20desc

entering this URL, the odata orders by the submitter

so I want to know how to solve this problem?THANK YOU VERY MUCH!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Alexander Henss
5 days ago
0

Hello,

maybe the answer is a bit late and you already found a solution for your Problem.

If not is it possible that the OData implementation does not implement the orderby functionality in a correct way or not for every property?

I am not that experienced with java OData Services but In OData Services developed in SEGW you need to implement the order by feature for every property you want to use for sorting.

Maybe this will help.

Cheers,

Alex

Share
10 |10000 characters needed characters left characters exceeded