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

Re: Data binding issue with JSON Model

$
0
0

hi sir,

 

i am using below code but error is showing (json model is not a function)

 

 

onInit: function() {

         debugger;

         var sUrl = "http://services.odata.org/V3/Northwind/Northwind.svc/Categories?$select=CategoryID";

         var oModel = new sap.ui.model.json.JSONMODEL(sUrl);

         sap.ui.getCore().byId("tbldetail").setModel(oModel);

   

    },

 

and my table is

<Table id="tbldetail">

                <columns>

                    <Column>

                        <Text text="CategoryID"></Text>

                    </Column>

                  

 

                </columns>

            </Table>

  

and also try this code

onInit: function() {

         debugger;

         var oModel = new sap.ui.model.json.JSONModel();

         serviceUrl =  "http://services.odata.org/V3/Northwind/Northwind.svc/Categories?$select=CategoryID";

         oModel.loadData(serviceUrl,null, false, "GET",false, false, null);

       

         value: [

                    {

                            "CategoryID": 1

                    },

         ]

    },

 

please help me and solve the problem and send me my mail

ashwanishrm744@gmail.com


Viewing all articles
Browse latest Browse all 3116

Trending Articles



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