Hi i have an object with the data like
{
status : [ "started", "completed"],
branch : [ "India", "Germany" ]
}
here i want to construct nested filters like the status is either started OR completed AND the branch is either India OR Germany
i tried with the code below
var oFilter = new sap.ui.model.Filter(
keys.forEach(function(v) {
var oItem = totalFilterValues[v];
if(v === "status"){
return new sap.ui.model.Filter(oItem.forEach(function(val) {
return new sap.ui.model.Filter("status",
sap.ui.model.FilterOperator.Contains, val);
}), false);
}
if(v === "branch"){
return new sap.ui.model.Filter(oItem.forEach(function(val) {
return new sap.ui.model.Filter("branch",
sap.ui.model.FilterOperator.Contains, val);
}), false);
}
}),true);
but was not working can you help me in this. i followed to the below code snippet.
var oFilter = new sap.ui.model.Filter(mFacetFilterLists.map(function(oList) {
return new sap.ui.model.Filter(oList.getSelectedItems().map(function(oItem) {
return new sap.ui.model.Filter(oList.getTitle(), "EQ", oItem.getText());
}), false);
}), true);
For multiple Filters:
Read more here SAPUI5 Filters