问题描述
我单击一个按钮,然后导航到一个我有一张桌子并试图过滤的视图.如果输入以下内容: filters:{path:'ReturnItemFlag'运算符:'EQ'value1:'Y'}
该视图无法加载.如果我删除那条线,它将加载.
I click a button and navigate to a view where I have a table and am trying to filter. If I enter this : filters: {path: 'ReturnItemFlag' operator: 'EQ' value1: 'Y'}
the view fails to load. If I remove that line, it loads.
此语法中可能有什么错误:我正在尝试根据项目是否具有"ReturnFlag" ="Y"
来过滤表中的行.如果有,那么我要显示该行.
What can be possibly wrong in this syntax: I am trying to filter the rows in table based on whether the item has "ReturnFlag" = "Y"
. If it has then I want to display the row.
<table:Table id="T1" class="table"
rows="{ path: 'takeStockOrderDetail>/ItemSet/results', filters: {path:
'ReturnFlag' operator: 'EQ' value1: 'Y'}, sorter: {path: 'partNumber'}}"
selectionMode="Single" selectionBehavior="RowOnly"
visibleRowCountMode="Fixed" visibleRowCount="7"
rowSelectionChange="onRowSelected">
推荐答案
是的,过滤器
语法存在问题.过滤器需要一个对象数组,其类型为sap.ui.型号.过滤器.
Yes, there is an issue with the filters
syntax. Filter expects an array of objects which are of type sap.ui.model.Filter.
这是解决此问题的方法:
Here is how you should fix this:
rows="{
path: 'takeStockOrderDetail>/ItemSet/results',
filters: [
{
path: 'ReturnFlag',
operator: 'EQ',
value1: 'Y'
}
],
sorter: {
path: 'partNumber'
}
}"
这篇关于在XML视图中过滤UI5聚合绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!