cancel
Showing results for 
Search instead for 
Did you mean: 

Expand selected node with it's all sub nodes

0 Kudos

Hello,

I have Top node as "12345" and Sub nodes as "45678" and "65478" under that subnodes i have more nodes. When i select and expand the selection only first sub nodes are expanded. I want expand more Deeper. i am passing value (3) but nothing happens.

onExpandSelection: function() {
			var oTreeTable = this.byId("TreeTableBasic");
			oTreeTable.expand(oTreeTable.getSelectedIndices(3));
		}
 

Accepted Solutions (0)

Answers (2)

Answers (2)

nabheetscn
Active Contributor
0 Kudos

While building the table you will need to store the maxlevel which you have and then pass to method expandToLevel. Otherway can be by just pass a random higher number it will open the complete tree for example oTreeTable.expandToLevel(1000); I tried it in SAPUI5 tree table example here and it worked.

Nabheet

0 Kudos

Hello Nabheet,

Thank you for the reply !

I have declared the oTreeTable.expandToLevel(5), as you know it expands all the Main nodes. As per the example if i see the expand first selection, i have understood the structure of controller. But i need to expand all the first selection node(First selection : Just expands the first node, but i need to expand all it's first node's Sub nodes)

F.e : 1->1.1->1.2->1.1.1->1.1.2->1.2.1->1.2.2

Something like above .

former_member208808
Active Participant
0 Kudos

Hello Nikhil,

Try expandToLevel instead of expand and let us know if you achieve the desired result or not ?

Also Expand method takes parameters as int and int[] (if you pass integer will be treated as single level to be expanded)

Thanks & regads,

AK K

Hello AK,

Thank you for the reply !

I have tried with expandToLevel and passing the parameter, it does not work as it suppose to be. It expands all my tree table but i need to expand only first selection my my tree table all it's sub node's.


Below picture explains, when i select and click on Expand selection. It expands only first level of node but i would want to expand all of the first and second node in this case. "General" and "Function". Expand whatever sub node inside the "General" same for function.

should reach to last node.