Skip to Content
0
Feb 17, 2016 at 12:18 PM

JSON object returns no data

21 Views

Hi All,

After creating a JSON model and loading data on it, i still cannot get the value inside that json object. My code is

var dataPath = "/test/medium.json";

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

oModel.loadData(dataPath);

When i try to print the contents inside the json object, it returns as undefined. The code i use to get object contents is:

alert(oModel.getData());

Can someone please comment on what i missing in my code. Thanks in advance!