Filter on more than one column

ε祈祈猫儿з 提交于 2019-12-05 20:55:34

Please see the following code:

var oFilter1 = new sap.ui.model.Filter("A", sap.ui.model.FilterOperator.Contains, sValue);
var oFilter2 = new sap.ui.model.Filter("B", sap.ui.model.FilterOperator.Contains, sValue);
var oFilter3 = new sap.ui.model.Filter("C", sap.ui.model.FilterOperator.Contains, sValue);
var oFilter4 = new sap.ui.model.Filter("D", sap.ui.model.FilterOperator.Contains, sValue);
var allFilter = new sap.ui.model.Filter([oFilter1,oFilter2,oFilter3,oFilter4]); 
var oBinding = oEvent.getSource().getBinding("items");
oBinding.filter(allFilter);

See documentation:

new sap.ui.model.Filter(aFilters, bAnd);

aFilters is an array of other instances of sap.ui.model.Filter. If bAnd is set all filters within the filter will be ANDed else they will be ORed.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!