Quantcast
Channel: SCN: Message List - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 8124

Dataset with multiple filter

$
0
0

Hi All,

 

I am currently implementing a DataSet application.

 

According to the dev guide (https://sapui5.netweaver.ondemand.com/sdk/#test-resources/sap/ui/ux3/demokit/DataSet.html)

 

I managed that the filter is working fine, as described above.

search: function search(oEvent) {                var sQuery = oEvent.getParameter("query");                var oBinding = oDataSet.getBinding("items");                oBinding.filter(!sQuery ? [] : [new sap.ui.model.Filter("title", sap.ui.model.FilterOperator.Contains, sQuery)]);                oDataSet.setLeadSelection(-1);        },

 

By this solution it is only possible to search for a specific bound property/attribute. Now I would like to search for ALL attributes.

E.g:  "title" and "systemtype" at the same time.

 

Let say there is an item with title="NetWeaver Administrator" and another one with systemtype= "NWDI"

 

So when I would trigger the search with "N" all both items should be displayed....

when triggering the search with "NW" only one item should be displayed.

 

In words: I want to search that either matches the title-value or the systemtype-value.

 

I tried following

 

search: function search(oEvent) {                var sQuery = oEvent.getParameter("query");                var oBinding = oDataSet.getBinding("items");                oBinding.filter(!sQuery ? [] : [new sap.ui.model.Filter("title", sap.ui.model.FilterOperator.Contains, sQuery),                                                           new sap.ui.model.Filter("systemtype", sap.ui.model.FilterOperator.Contains, sQuery)                ]);                oDataSet.setLeadSelection(-1);        },

 

But this seems to display only those items where "title" AND "systemtype" matches.

 

Does anyone have an idea how to archieve this.

 

Regards,

 

Jens


Viewing all articles
Browse latest Browse all 8124

Trending Articles



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