Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mycontroller = this
- var data =
- [
- {"No":"456980",
- "Updates":[{ "Test": "abc"}, {"Test": "bca"},{"Test": "dbd"}] },
- {"No":"456980",
- "Updates":[{ "Test": "abc"}, {"Test": "bca"},{"Test": "dbd"}] },
- {"No":"456980",
- "Updates":[{ "Test": "abc"}, {"Test": "bca"},{"Test": "dbd"}] }
- ]
- var oModel = new sap.ui.model.json.JSONModel();
- oModel.setData(data);
- //set this model to list control having custom list as aggregation
- mycontroller.List1.setModel(oModel);
- mycontroller.List1.bindAggregation("items",{path:"/",template:mycontroller.List1_template});
- var ListItems = P1Notificationcontroller.list1.getItems();
- var ListLength = ListItems.length;
- for(var i=0; i<ListLength; i++){
- var control = "status_vbox-list1-"+i;
- sap.ui.getCore().byId(control).bindAggregation("items",{path:"Updates",template:new sap.m.Text('',{text:'{Update}'})});
- }
- oController.List1 = new sap.m.List("List1",{headerDesign : sap.m.ListHeaderDesign.Standard});
- oController.List1_template = new sap.m.CustomListItem("McustomlistItem",{content : [
- new sap.m.VBox('',{items:
- [
- new sap.m.Text('',{text:"{No}"})
- new sap.m.VBox('status_vbox',{items:[]})
- ]
- }));
- var jsonmodel = new sap.ui.model.json.JSONModel("mockData/local.json");
- mycontroller.List1.setModel(jsonmodel)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement