指定测试参数时出错 'Wrong parameters defined for filter'
Error 'Wrong parameters defined for filter' when specifying test parameter
我只想显示 属性 title!==null
的行
var filter = new sap.ui.model.Filter({path:"title",test:function(oValue){
return oValue!==null;
}
});
但我有一个错误:Wrong parameters defined for filter.
这是我使用的 API:https://openui5.hana.ondemand.com/docs/api/symbols/sap.ui.model.Filter.html
如何正确设置过滤器?
我已经更新了运行时,现在我可以使用我的个人测试功能来测试瓷砖了!
参数映射的test
属性指定函数的功能出现在1.26。在之前的 1.24 版本中这是不可能的。根据您的评论,您是 运行 1.24,因此出现错误。
FWIW,这是 sap/ui/model/Filter.js 在 1.24 和 1.26 中的详细信息:
1.24:
/**
* Constructor for Filter
* You can either pass an object with the filter parameters or use the function arguments
*
* Using object:
* new sap.ui.model.Filter({
* path: "...",
* operator: "...",
* value1: "...",
* value2: "..."
* })
*
* OR:
* new sap.ui.model.Filter({
* filters: [...],
* and: true|false
* })
1.26:
/**
* Constructor for Filter
* You can either pass an object with the filter parameters or use the function arguments
*
* Using object:
* new sap.ui.model.Filter({
* path: "...",
* operator: "...",
* value1: "...",
* value2: "..."
* })
*
* OR:
* new sap.ui.model.Filter({
* path: "...",
* test: function(oValue) {
* }
* })
*
* OR:
* new sap.ui.model.Filter({
* filters: [...],
* and: true|false
* })
我只想显示 属性 title!==null
var filter = new sap.ui.model.Filter({path:"title",test:function(oValue){
return oValue!==null;
}
});
但我有一个错误:Wrong parameters defined for filter.
这是我使用的 API:https://openui5.hana.ondemand.com/docs/api/symbols/sap.ui.model.Filter.html
如何正确设置过滤器?
我已经更新了运行时,现在我可以使用我的个人测试功能来测试瓷砖了!
参数映射的test
属性指定函数的功能出现在1.26。在之前的 1.24 版本中这是不可能的。根据您的评论,您是 运行 1.24,因此出现错误。
FWIW,这是 sap/ui/model/Filter.js 在 1.24 和 1.26 中的详细信息:
1.24:
/**
* Constructor for Filter
* You can either pass an object with the filter parameters or use the function arguments
*
* Using object:
* new sap.ui.model.Filter({
* path: "...",
* operator: "...",
* value1: "...",
* value2: "..."
* })
*
* OR:
* new sap.ui.model.Filter({
* filters: [...],
* and: true|false
* })
1.26:
/**
* Constructor for Filter
* You can either pass an object with the filter parameters or use the function arguments
*
* Using object:
* new sap.ui.model.Filter({
* path: "...",
* operator: "...",
* value1: "...",
* value2: "..."
* })
*
* OR:
* new sap.ui.model.Filter({
* path: "...",
* test: function(oValue) {
* }
* })
*
* OR:
* new sap.ui.model.Filter({
* filters: [...],
* and: true|false
* })