Skip to Content
0
Apr 21, 2020 at 02:18 PM

How to pre-fill the selection in tree like structure in SAPUI5

74 Views

Hi Colleagues,

I am using a tree like structure to show the hierarchical view of my data. The binding data is like you see below. I am using MultiSelect mode and want to pre-select values that I receive from a API(data is similar to the binding data but with just selected values). I am using the StandardTreeItem inside the tree. How can I do this?

[
	{
		"nodes": [
			{
				"dummyId": "abc1",
				"dummyTitle": "Title1"
			},
			{
				"nodes": [
					{
						"dummyId": "abc2",
						"dummyTitle": "Title2"
					},
					{
						"dummyId": "abc3",
						"dummyTitle": "Title3"
					}
				],
				"dummyId": "abc4",
				"dummyTitle": "Title4"
			}
		],
		"dummyId": "abc5",
		"dummyTitle": "Title5"
	}
]