sapui5ui5-tooling

Demo Kit provides samples for code. How to actually use those locally?


I just started using SAPUI5 and I am actually curious on how the samples work.

For example: https://ui5.sap.com/#/entity/sap.f.FlexibleColumnLayout/sample/sap.f.sample.FlexibleColumnLayoutColumnResize

I downloaded it and opened using an editor. However, I don't see any mock data or .json.

Is that on purpose? I was actually expecting to see the code for the sample, with the sample data.


Solution

  • The data gets loaded from https://ui5.sap.com/test-resources/sap/f/demokit/sample/FlexibleColumnLayoutColumnResize/webapp/data/sections.json

    See line 23 in Component.js: var oProductsModel = new JSONModel("./data/sections.json");

    You can find details on how to set up a JSON model in Step 7 of SAPUI5 Walkthrough - a tutorial with all major UI5 development paradigms.