Skip to content

Instantly share code, notes, and snippets.

@sodogan
Created December 16, 2021 11:17
Show Gist options
  • Save sodogan/ec6fdc1620c7b62d3a3d20285b4d23cd to your computer and use it in GitHub Desktop.
Save sodogan/ec6fdc1620c7b62d3a3d20285b4d23cd to your computer and use it in GitHub Desktop.
SAPUI5 extended formatter
sap.ui.define([
"sap/ui/base/Object"
], function (BaseObject) {
"use strict";
return BaseObject.extend("com.sodogan.Products.model.formatter.obj", {
/**
* @param {sap.ui.core.UIComponent} oComponent reference to the app's component
*/
constructor: function (oComponent) {
this._oComponent = oComponent;
this._oResourceBundle = oComponent.getModel("i18n").getResourceBundle();
this._oModel = oComponent.getModel("odataDetails");
},
generateBackendData: function () {
// you can access this._oModel here and do stuff
return {
name: 'solen',
age: 39
};
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment