Advertisement
Guest User

Untitled

a guest
May 27th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. mycontroller = this
  2.  
  3. var data =
  4. [
  5. {"No":"456980",
  6. "Updates":[{ "Test": "abc"}, {"Test": "bca"},{"Test": "dbd"}] },
  7. {"No":"456980",
  8. "Updates":[{ "Test": "abc"}, {"Test": "bca"},{"Test": "dbd"}] },
  9. {"No":"456980",
  10. "Updates":[{ "Test": "abc"}, {"Test": "bca"},{"Test": "dbd"}] }
  11. ]
  12. var oModel = new sap.ui.model.json.JSONModel();
  13. oModel.setData(data);
  14.  
  15. //set this model to list control having custom list as aggregation
  16. mycontroller.List1.setModel(oModel);
  17.  
  18. mycontroller.List1.bindAggregation("items",{path:"/",template:mycontroller.List1_template});
  19.  
  20. var ListItems = P1Notificationcontroller.list1.getItems();
  21. var ListLength = ListItems.length;
  22.  
  23. for(var i=0; i<ListLength; i++){
  24. var control = "status_vbox-list1-"+i;
  25. sap.ui.getCore().byId(control).bindAggregation("items",{path:"Updates",template:new sap.m.Text('',{text:'{Update}'})});
  26. }
  27.  
  28. oController.List1 = new sap.m.List("List1",{headerDesign : sap.m.ListHeaderDesign.Standard});
  29. oController.List1_template = new sap.m.CustomListItem("McustomlistItem",{content : [
  30. new sap.m.VBox('',{items:
  31. [
  32. new sap.m.Text('',{text:"{No}"})
  33. new sap.m.VBox('status_vbox',{items:[]})
  34. ]
  35. }));
  36.  
  37. var jsonmodel = new sap.ui.model.json.JSONModel("mockData/local.json");
  38. mycontroller.List1.setModel(jsonmodel)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement