on 2021 Jul 13 2:14 AM
Dear colleagues,
I would like to use the integration card's "custom formatter" functionality.
The documentation mentions that a custom formatter can be defined and then used "in the manifest the same way as the already predefined formatters which the card provides". (link)
Is there an example on how this custom formatter is defined and used within the manifest?
Hi Mirko
we can use custom formatters in the integration card as follows
"sap.card": {
"type": "Analytical",
"extension": "utils/FormatterExtension",
...
} ...
...
"mainIndicator": {
"number": "{path:'n', formatter:'extension.formatters.randomSuffix'}",
"unit": "{u}"
}
...
sap.ui.define(["sap/ui/integration/Extension"], function (Extension) {
"use strict";
var CardExtension = Extension.extend("com.sap.easyui5app.easyui5app.utils.FormatterExtension");
// should return a promise
CardExtension.prototype.randomSuffix = function (val) {
// formatter logic //
return val;
};
CardExtension.prototype.getFormatters = function() {
return {
randomSuffix: this.randomSuffix
}
};
return CardExtension;
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
8 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.