sapui5 - How to access Object inside Object (JSON) in UI5 -
i have json data structure :
0: object folder: object nodeid: object nodelevel: object nodetype: object nodetext: object ... if expand these nodes again contains #text: data.
0: object folder: object nodeid: object nodelevel: object #text: "07" nodetype: object nodetext: object #text: "[exploratory] translation of document in ria" ... i want display these data on table of sapui5. code :
var ocol; ocol = new sap.ui.table.column({ label: new sap.ui.commons.label({text: "test plan"}), template: new sap.ui.commons.textview().bindproperty("text", "#text"), width: "450px", resizable : false }); otable.addcolumn(ocol); and binding data :
var omodel = new sap.ui.model.json.jsonmodel(); omodel.setdata(mygtp); otable.setmodel(omodel); otable.bindrows("/nodetext"); in case, want see text under nodetext node. cannot reach data want. ideas?
try this: http://jsbin.com/suce/1/edit?html,output
not totally sure if reflected model correctly.
if model contains hierarchical data use treetable visualization. if want display in flat table data needs flat well. aggregation bindings possible against arrays inside of json data.
Comments
Post a Comment