5
votes

I am using SmartTable with property useTablePersonalisation set to true which generates P13n dialog by button enter image description here. According to the manual I should be able to change data type of filter operator:

The second field offers an operator for specifying the filter in more detail. The operators that are available depends on the data type of the selected column.

I am interested in these two options from manual: enter image description here

I want to get "string type" option, which autogenerates this:

enter image description here

But I am still getting option autogenerated for "number type" instead of "string type". I declared this field as Edm.String in the backend entity.

enter image description here

Please do you have any idea how to resolve this issue?

Here is my xml code, Abc is Edm.String:

                        <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>

I was trying to change data type to "sap.ui.model.type.String" of CustomData in the xml table definition or in the ColumnListItem but maybe I am doing something wrong. I must use 1.38 UI5 version.

Thanks for any device.

2
How is the field defined in your metadataJorg
It is defined as Edm.String.Jaro

2 Answers

0
votes

Since you are using the custom columns in the smart table you need to define "type" property in the custom data of your column.
Following types should be used for different data types:

  1. string
  2. numeric
  3. date

you can see the sample code in the URL mentioned, here they have used type numeric in the example.

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

-1
votes

You can check the SAP UI5 example from the below link: https://ui5.sap.com/#/entity/sap.ui.comp.smarttable.SmartTable/sample/sap.ui.comp.sample.smarttable.mtableCustom/code

Basically you need to use ' "type": "text" ' in the custom data along with the sort and filter property.

Thanks, Mahesh