如果我想要设置一个不显示行的过滤器,如果至少有一个过滤器返回false,那么我有一个问题:当从path链接的值为null时,我的函数没有运行..
simpleTable: function (idTable){
var allFilter=[];
allFilter.push(new sap.ui.model.Filter("prop1/code", ui5bp.modelManager._isNotNull));
allFilter.push(new sap.ui.model.Filter("prop1/description", ui5bp.modelManager._isNotNull));
allFilter.push(new sap.ui.model.Filter("prop2/code", ui5bp.modelManager._isNotNull));
allFilter.push(new sap.ui.model.Filter("prop2/description", ui5bp.modelManager._isNotNull));
allFilter.push(new sap.ui.model.Filter("prop3", ui5bp.modelManager._isNotNull));
allFilter.push(new sap.ui.model.Filter("prop4", ui5bp.modelManager._isNotNull));
var oTable = sap.ui.getCore().byId(idTable);
var oBinding = oTable.getBinding("items");
oBinding.filter(allFilter, "crud", false);
},
_isNotNull: function (oValue) {
var bNotNull = (oValue!==null);
return (bNotNull);
}
如果在模型中与路径对应的值(例如prop1/description
)为null
,_isNotNull
函数无法启动,我无法测试该值是否为null或不