Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2878

Re: Formatter function is not defined..

$
0
0

this is my view

-------------------------------------------------------------------------

<mvc:View

controllerName="test4odata.controller.View1"

xmlns:html="http://www.w3.org/1999/xhtml"

xmlns:mvc="sap.ui.core.mvc"

xmlns="sap.m">

  <App>

  <pages>

  <Page title="{i18n>title}">

  <content>

  <Table

  items = "{/Products}">

  <columns>

  <Column>

  <Text text ="Rating"/>

  </Column>

 

  <Column>

  <Text text= "Price"/>

  </Column>

 

  <Column>

  <Text text= "status"/>

  </Column>

  </columns>

 

  <items>

  <ColumnListItem>

  <cells>

  <Text text = "{Rating}"/>

  <Text  text= "{Price}"/>

  <Text text = "{

         path: '/Price',

         formatter:'test4odata.model.formatter.status '

         }" />

  </cells>

  </ColumnListItem>

  </items>

  </Table>

  </content>

  </Page>

  </pages>

  </App>

</mvc:View>

------------------------------------------------------------

 

this is my controller file.

-----------------------------------------------------------

jQuery.sap.require("test4odata.model.formatter");

sap.ui.define([

  "sap/ui/core/mvc/Controller"

], function(Controller) {

  "use strict";

 

 

  return Controller.extend("test4odata.controller.View1", {

 

  onInit: function() {

  var oModel = new sap.ui.model.odata.ODataModel("/destinations/NorthwindV2/V2/OData/OData.svc",true);

 

 

  /* oModel.read('/Products', null, null, true, function(oData, oResponse){

 

 

  alert("fhhjfhjf");

 

 

  });

  */

  this.getView().setModel(oModel);

  

 

 

  }

 

 

 

 

 

  });

 

 

});

----------------------------------------------------

 

this is my index.html

-------------------------------------------------

<!DOCTYPE HTML>

<html>

 

 

  <head>

  <meta http-equiv="X-UA-Compatible" content="IE=edge" />

  <meta charset="UTF-8">

 

 

  <title>test4odata</title>

 

 

  <script id="sap-ui-bootstrap"

  src="../../resources/sap-ui-core.js"

  data-sap-ui-libs="sap.m"

  data-sap-ui-theme="sap_bluecrystal"

  data-sap-ui-compatVersion="edge"

  data-sap-ui-resourceroots='{"test4odata": ""}'>

  </script>

 

 

  <link rel="stylesheet" type="text/css" href="css/style.css">

 

 

  <script>

  sap.ui.getCore().attachInit(function() {

  new sap.m.Shell({

  app: new sap.ui.core.ComponentContainer({

  height : "100%",

  name : "test4odata"

  })

  }).placeAt("content");

  });

  </script>

  </head>

 

 

  <body class="sapUiBody" id="content">

  </body>

 

 

</html>

---------------------------------------------------------

 

this is my project structure.

proj structure.PNG


Viewing all articles
Browse latest Browse all 2878

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>