Skip to Content
avatar image
Former Member

Unable to display child nodes in SAP UI5 Tree Table using JSON data

Hi Everyone,I am consuming JSON data and binding to TreeTable as shown in Plunker. I am unable to show tree structure in Parent chiLd hirearchy. where everything is showing as parent nodeCould any one please help me how to get child nodes for the data shown in Plunker. if the data format is wrong for Tree Table Binding Kindly suggestThanks,Best Regards,Viswanath

Add comment
10|10000 characters needed characters exceeded

  • Hello Viswanath,

    Did you get this issue solved ? Instead of tree structure json, where you able to map it directly from flat structure in json format ?

    Thanks.

  • Get RSS Feed

2 Answers

  • Best Answer
    Jan 30, 2017 at 03:18 PM

    you have to change your json structure, make it as tree, currently it is flat.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Jun,

      when I am binding using ODATA model I am unable to bind. I am getting below attached error

      So I am converting using JSON model and Binding. Could you please help in binding using ODATA annotations for the mentioned flat format data

      oModel.read("/BrandSet",null,null,true,
      				function Sucess(oData){
      			oView.setModel(new sap.ui.model.json.JSONModel(oData), "BrandTree");
      		},function error(response){
      			console.log(response);
      		});
      
      capture.png (9.6 kB)
  • Jan 30, 2017 at 01:45 PM

    HI Vishwanath ,

    Your Json and binding to tree table is incorrect, can you please refer this example code.

    thanks

    Viplove

    Add comment
    10|10000 characters needed characters exceeded

    • Actually method not allow error comes when your service doesn't support any operation like batch , POST , PUT,DELETE ,GET

      Why its giving metadata definition incorrect - because odata call will first check the metadata(as this is the info or definition of the service) regrading the methods allowed.

      thanks

      Viplove