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