Hi All,
I'm trying to format values using formatter in table but it is not working and empty values are showing in table.
Please see my code and resolve my issue
In View:
.........
<items>
<ColumnListItem press="onPress">
<cells>
<Text id="otext1" xmlns="sap.m" text="{value1}" />
<Text id="otext2" xmlns="sap.m" text="{path:'value2' ,
formatter : '.formatter.converter'}"/>
<Text xmlns="sap.m" text="{value2}" />
<Text xmlns="sap.m" text="{value3}" />
<Text xmlns="sap.m" text="{value4}" />
In controller:
sap.ui.define([ "sap/ui/core/mvc/Controller", "chartswithxml/formatter" ],
function(Controller, formatter) {
"use strict";
return Controller
.extend("chartswithxml.S1",
{
formatter : formatter,
onInit : function() {
var oModel = new sap.ui.model.odata.ODataModel("Odata model/");
this.getView().setModel(oModel);
.........
Finally formatter.js
sap.ui.define([], function () {
"use strict";
return {
converter : function (sConverter) {
//var s = this.getView().getModel().getData();
return sConverter/1000;
}
};
});