Quantcast
Channel: SCN: Message List - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 8124

Re: Load local JSON into SAPUI5-tree

$
0
0

Hi,

For example, if your app it's deployed with this context path /yourapp and you place a resource file with your json model in /yourapp/resources/oNewData, you could load replacing hardcoded model in view with this sentence:

 

https://sapui5.netweaver.ondemand.com/sdk/#docs/api/symbols/sap.ui.model.json.JSONModel.html#loadData

 

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

newModel.loadData("/yourapp/resources/oNewData", '', false); //false = load sync model

//data process

 

Kind regards!


Viewing all articles
Browse latest Browse all 8124

Trending Articles