Skip to Content
avatar image
Former Member

sap.m.tree implementation or exapmples

Hi all, I have been trying to implement the sap.m.tree for multilevel hierarchy data, and the attribute names are different. I have been through the FIORI guidelines https://experience.sap.com/fiori-design-web/tree/ for the same and I understand that is the exact control I need. from the SAPUI5 explored https://sapui5.hana.ondemand.com/explored.html#/entity/sap.m.Tree/samples I couldn't get much of help as they have the example over the same data and there are no aggregations. Can anyone help me with a lead, an example would be highly appreciated

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jul 28, 2017 at 04:32 PM

    Hello Arjun,

    Have you checked openui5/src/sap.m/test/sap/m/demokit/sample/Tree/?

    Best regards

    Frank

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 28, 2017 at 08:58 AM

    Hello Arjun,

    Please check sap.m.Tree in the SAPUI5 Explored app.

    Best regards

    Frank

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Frank thanks for the reply, as you note that I already have checked the explored app. Which is limited with the details on what can be done when there are hierarchy of data wit different attribute names.

      for Eg

      the code will fail to iterate through

      region : [

      {"menu": {
        "id": "file",
        "value": "File",
        "popup": {
          "menuitem": [
            {"item": "New", "onclick": "CreateNewDoc()"},
            {"item": "Open", "onclick": "OpenDoc()"},
            {"item": "Close", "onclick": "CloseDoc()"}
          ]
        }
      }}

      As its not the first node has value and the child is having an item.