代码之家  ›  专栏  ›  技术社区  ›  Jaro

在智能表的P13n对话框的Filter选项卡中添加contains filtering选项

  •  5
  • Jaro  · 技术社区  · 7 年前

    SmartTable 属性UseTablePersonalization设置为true,按按钮生成P13n对话框 enter image description here . 根据 manual 我应该能够更改筛选器运算符的数据类型:

    第二个字段提供了一个运算符,用于更详细地指定过滤器。可用的运算符取决于选定列的数据类型。

    我对这两种选择感兴趣 手册 : enter image description here

    我想得到“字符串类型”选项,它自动生成:

    enter image description here

    但我仍然在为“数字类型”而不是“字符串类型”自动生成选项。我在后端实体中将此字段声明为Edm.String。

    enter image description here

    你知道怎么解决这个问题吗?

    这是我的xml代码,Abc是Edm。字符串:

                            <smartTable:SmartTable id="idSmartTable" smartFilterId="idSmartFilterBar" tableType="ResponsiveTable" entitySet="AbcSet"
                            useVariantManagement="false" useTablePersonalisation="true" header=" " showRowCount="true" enableAutoBinding="true" useExportToExcel="false"
                            showFullScreenButton="true">
                            <Table growing="true" mode="None">
                                <columns>
                                    <Column>
                                        <customData>
                                            <core:CustomData key="p13nData" value='\{"columnKey": "Abc","leadingProperty": "Abc","sortProperty": "Abc","filterProperty": "Abc"}'/>
                                        </customData>
                                        <header><Text text="{i18n>Abc}" wrapping="false"/></header>
                                    </Column>                                                                   
                                </columns>
                                <items>
                                    <ColumnListItem>
                                        <cells>
                                            <Text text="{Abc}"/>                                            
                                        </cells>
                                    </ColumnListItem>
                                </items>
                            </Table>
                        </smartTable:SmartTable>
    

    我试图将数据类型更改为“sap.ui.model.type.String” CustomData 在xml表定义或 ColumnListItem 但也许我做错了什么。我必须使用1.38ui5版本。

    谢谢你的设备。

    0 回复  |  直到 7 年前
        1
  •  0
  •   Shubh_2404    6 年前

    由于使用的是智能表中的自定义列,因此需要在列的自定义数据中定义“type”属性。
    以下类型应用于不同的数据类型:

    1. 一串
    2. 日期

    您可以在上面提到的URL中看到示例代码,这里他们在示例中使用了numeric类型。

    [ https://ui5.sap.com/#/entity/sap.ui.comp.smarttable.SmartTable/sample/sap.ui.comp.sample.smarttable.mtableCustom/code]

        2
  •  -1
  •   mahesh0431    6 年前

    您可以通过以下链接查看SAP UI5示例: https://ui5.sap.com/#/entity/sap.ui.comp.smarttable.SmartTable/sample/sap.ui.comp.sample.smarttable.mtableCustom/code

    基本上,您需要在自定义数据中使用“type”:“text”以及sort和filter属性。

    谢谢, 马赫什

    推荐文章