How can I use typeInstance instead of type in p13n dialog?

£可爱£侵袭症+ 提交于 2020-08-10 20:07:35

问题


I already asked a question here regarding ignoring of type of a custom column by smart table in new version of SAPUI5.

In the work around I discovered in the API that I can use a new property called typeInstance instead of type:

Now the question is how can I pass a typeInstance object instead of type in smart table xml definition:

<Column visible="true">
    <customData>
        <core:CustomData key="p13nData" 
            value='{
                "columnKey": "Datum", 
                "leadingProperty": "Datum", 
                "sortProperty": "Datum", 
                "filterProperty": "Datum", 
                "columnIndex":"3", 
                "type": "date", 
                "typeInstance": {???} 
            }'/>
        </customData>
    <Text text="{/#Meldungen/Datum/@sap:label}"/>
</Column>

What do I have to write instead of ????

I discovered the typeInstance must represent the sap.ui.model.type.Date based on the code that I extracted from P13nConditionPanel.js in SAPUI5 library:

Also when I define it like this:

<Column visible="true">
    <customData>
        <core:CustomData key="p13nData"
            value='{
                "columnKey": "Datum", 
                "leadingProperty": "Datum", 
                "sortProperty": "Datum", 
                "filterProperty": "Datum", 
                "columnIndex":"3", 
                "type": "numeric", 
                "typeInstance": {
                    "type":"sap.ui.model.type.Date"
                } 
           }'/>
    </customData>
    <Text text="{/#Meldungen/Datum/@sap:label}"/>
</Column>

Then it will take the value from typeInstance and ignore the type property:

来源:https://stackoverflow.com/questions/63260845/how-can-i-use-typeinstance-instead-of-type-in-p13n-dialog

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!