gpt4 book ai didi

sapui5 - 从 SmartTable 中删除过滤器选项

转载 作者:行者123 更新时间:2023-12-05 09:19:18 26 4
gpt4 key购买 nike

我们已经实现了 SmartTable,一切正常。我只想删除 SmartTable useTablePersonalisation 选项提供的 Filter 选项。

这可能吗?

问候,马亚克

最佳答案

您可以通过 customData 从 SmartTable 的嵌入式 P13nDialog 中删除过滤器(和所有其他选项),如本 SAPUI5 Explored Sample: P13nDialog with disabled 'Filter' tab - Variation 所示。 .

SmartTableWithoutFilterOption.view.xml

<core:View xmlns:core="sap.ui.core" xmlns="sap.ui.comp.smarttable"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:customData="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1"
controllerName="my.namespace.SmartTableWithoutFilterOption">

<SmartTable
tableType="ResponsiveTable" header="A bunch of data"
enableAutoBinding="true" entitySet="RecordSet"
customData:p13nDialogSettings='{filter:{visible:false}}' />
</core:View>

请注意,您需要为 customData:p13nDialogSettings 属性声明 xmlns:customData 命名空间。

但您也可以使用更长的 customData 聚合符号。

SmartTableWithoutFilterOptionLongNotation.view.xml

<core:View xmlns:core="sap.ui.core" xmlns="sap.ui.comp.smarttable"
xmlns:html="http://www.w3.org/1999/xhtml"
controllerName="my.namespace.SmartTableWithoutFilterOptionLongNotation">

<SmartTable
tableType="ResponsiveTable" header="A bunch of data"
enableAutoBinding="true" entitySet="RecordSet">
<customData>
<core:CustomData
key="p13nDialogSettings"
value='\{
"filter": \{ "visible": false}
}' />
</customData>
</SmartTable>
</core:View>

要隐藏其他选项,请使用 columnssortgroup 而不是 filter。您还可以组合这些设置以隐藏多个选项。以下代码将只允许过滤。

<core:CustomData
key="p13nDialogSettings"
value='\{
"columns": \{ "visible": false},
"sort": \{ "visible": false},
"group": \{ "visible": false}
}' />

关于sapui5 - 从 SmartTable 中删除过滤器选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41166591/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com