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

Re: How to pass the data from database(ODATA) to Json model for using list

$
0
0

Hi all,

This is working fine.and thank you for your response,

The code is

In xml view put entity set as "A>/List/results",

 

 

onInit : function(){

  oController=this;

  oController2=this;

  var that=this;

  oController.oData1 = new sap.ui.model.odata.ODataModel ("url",true);

 

 

  var fnSuccess=function(oData,oResponse)

  {

 

 

 

             var jsonArray ={

            "List":oData

             } 

 

 

           

 

 

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

sap.ui.getCore().setModel(oJSONModel);

oJSONModel.setData(jsonArray);

 

 

 

 

oController.getView().setModel(oJSONModel,"A");

 

 

 

 

}

  oController.oData1.read("/MatSet ",null,null,true,fnSuccess)

// oController.setModel(oJSONModel);

  },


Viewing all articles
Browse latest Browse all 3510

Trending Articles



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