问题
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.
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">
回答1:
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'
}
}"
来源:https://stackoverflow.com/questions/50981824/filter-ui5-aggregation-binding-in-xml-view