sapui5 - 如何在过滤栏中显示 filterGroupItems?
问题描述
我有以下过滤栏:
<mvc:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" controllerName="ch.example.northwind.controller.Customers"
xmlns:fb="sap.ui.comp.filterbar" xmlns:html="http://www.w3.org/1999/xhtml">
<Page title="{i18n>title}" showNavButton="true" navButtonPress="onNavPressBack">
<content>
<fb:FilterBar reset="onReset" search="onSearch" showRestoreButton="true" showClearButton="true" showGoOnFB="false">
<fb:filterGroupItems>
<fb:FilterGroupItem groupName="G1" groupTitle="Group1" name="A" label="Company" labelTooltip="Tooltip GroupItem Example">
<fb:control>
<Input type="Text"/>
</fb:control>
</fb:FilterGroupItem>
<fb:FilterGroupItem groupName="G1" groupTitle="Group1" name="B" label="Customer">
<fb:control>
<Input type="Text"/>
</fb:control>
</fb:FilterGroupItem>
<fb:FilterGroupItem groupName="G2" groupTitle="Group2" name="A2" label="Supplier" labelTooltip="Tooltip GroupItem Example">
<fb:control>
<Input type="Text"/>
</fb:control>
</fb:FilterGroupItem>
<fb:FilterGroupItem groupName="G2" groupTitle="Group2" name="B2" label="Category">
<fb:control>
<Input type="Text"/>
</fb:control>
</fb:FilterGroupItem>
</fb:filterGroupItems>
</fb:FilterBar>
</content>
</Page>
</mvc:View>
它看起来像:
如何FilterGroupItem G1
在栏上显示?
正如您在栏上看到的那样,它说:
要在此处显示过滤器,请将它们添加到过滤器中的过滤器栏
这是什么意思?我找不到过滤器属性。
解决方案
如果您单击过滤器,过滤器就在那里,但是它们不会显示为默认值。
要使它们在代码中默认可见,您可以将 FilterGroupItem 的属性 visibleInFilterBar 设置为 true。例如:
<fb:FilterGroupItem visibleInFilterBar="true" groupName="G1" groupTitle="Group1" name="A" label="Company" labelTooltip="Tooltip GroupItem Example">
<fb:control>
<Input type="Text"/>
</fb:control>
</fb:FilterGroupItem>
该指令To show filters here, add them to the filter bar in Filters
是指在应用程序中的用法。在您的屏幕截图中,右侧有“过滤器”按钮。这就是所谓的“过滤器”。如果单击此按钮,您将能够看到所有过滤器。如果您选中该复选框,它们将出现在过滤器栏中。它们只是没有作为默认值添加。
推荐阅读
- ruby-on-rails - 如何在整个网站上保持查询的持久性
- c# - 如何在c#中将int变量分配给空?
- go - 在使用 go sql 时,在每种类型中重写 Scan 和 Value 方法时避免重复代码
- java - 使用 Hbase RowCounter 时找不到方法
- apache - 带有 Flask 和 Pysnmp 的 Apache2 - OSError:无法加载本机模块“Cryptodome.Cipher._raw_ecb”:尝试“_raw_ecb.pyd”:
- tensorflow - 试图重新训练一个张量流模型,输入和输出节点消失
- php - 获取从 A 点到 B 点的 CPU 指令数 A 脚本编译成 PHP
- flask - 烧瓶渲染模板返回没有错误的空白页
- node.js - 找不到模块 node.js
- python - 大型 CSV 文件,只有一列用作使用多处理的函数的参数