Prateek
Prateek

Reputation: 51

SAPUI5 - ComboBox/Dropdown or Menu to display Hierarchy data

I need to make a ComboBox or Dropdown, which can have nested data, such as this

  var data = [{
    "text": "A",
    "icon": "1.gif",
    "innerObject": [{
        "text": "A.A",
        "icon": "1-1.gif"
    }, {
        "text": "A.B",
        "icon": "1-2.gif"
    }]
}, {
    "text": "B",
    "icon": "2.gif",
    "innerObject": [{
        "text": "B.A",
        "icon": "2-1.gif"
    }]
}]

I need to display it in a ComboBox or Dropdown, which can display its hierarchy. Is there any sample in SAPUI5 for this?

I also tried exploring Menu for this requirement, but I am not able to load menu and submenu dynamically. -Prateek

Upvotes: 0

Views: 2009

Answers (1)

nistv4n
nistv4n

Reputation: 2535

Selects (Dropdown) and Comboboxes supports only Item objects, which cannot contain other Items.

You can use Value Help Dialog to display any kind of data in a popup (for example a tree table, which supports hierarchical structures).

Of course, you can create your own control, but it's the most complicated solution.

Upvotes: 1

Related Questions