Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

Data binding with Multiple Filter

$
0
0

Hi Experts,

 

I am trying to do the data binding using filters with multiple values.

 

ex: I am selecting the multiple values from list dialog and those i want to pass to odata service as a filters.

 

name : abc

               pqr

 

I am looping on above and pushing it to array of filters.

 

     jQuery.sap.require("sap.ui.model.FilterOperator");

     var FilterOperator = sap.ui.model.FilterOperator;

     var filtersTerr =  new Array();


   for(i=0;i<name.length;i++){

  filterName = new sap.ui.model.Filter("FirstName", sap.ui.model.FilterOperator.EQ, name[i]);

  filter.push(filterName );

   }

this..getBinding("items").filter([filter],false);

 

Final filter should be something $filter=FirstName='abc' or FirstName='pqr'.

 

I have already looked into below discussions but somehow came to conclusion that array cannot be use with OR/AND.

 

Odata Filter with OR

http://scn.sap.com/thread/3462246

http://scn.sap.com/thread/3560814

 

Please let me know how this needs to be written.

 

Thanks,

Rahul


Viewing all articles
Browse latest Browse all 6178

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>