cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 TreeTable json odata

0 Kudos

Hi,

I am trying to create tree table using sap.ui.table.TreeTable. So far when i was using demo JSON data it worked, but now i wold like to take data from SAP- oDATA. from flat JSON like below:

{
  "d" : {
    "__count" : "2",
    "results" : [
      {
        "__metadata" : {
          "id" : "XXX/sap/opu/odata/sap/ZNODE/entity1('0012')",
          "uri" : "XXX/sap/opu/odata/sap/ZNODE/entity1('0012')",
          "type" : "ZNODE.SRV.entity1"
        },
        "Aktnr" : "",
        "Hierarchylevel" : "0000",
        "Vkdab" : null,
        "Parentid" : "0012",
        "Vkdbi" : null,
        "Id" : "0012",
        "Artnr" : "",
        "Name" : "testname",
        "Werks" : "",
        "Prio" : "",
        "ChildNodes" : {
          "__deferred" : {
            "uri" : "XXX/sap/opu/odata/sap/ZNODE/entity1('0012')/ChildNodes"
          }
        }
      },
      { 

.....

I tried to follow the tutorial from here https://blogs.sap.com/2015/10/23/treetable-odata-binding/ but the effect is like this:

So I have headers, but no childrens.

Here how i bind rows.
oTable.bindRows({ path: "tabMain1>/d/results/",
parameters: {
expand: "tabMain1>ChildNodes",
navigation: { "tabMain1>Konflikty_entitySet": "tabMain1>ChildNode"}
}
});

No idea how to move forward. Can any body give me suggestion?

best regards Krzysztof

Accepted Solutions (0)

Answers (0)