cancel
Showing results for 
Search instead for 
Did you mean: 

How to make sapui5 treetable expanded by default in a list report app.

veronica_09
Explorer
0 Kudos

Hello Folkes!

I am new to sap ui5, I would like  to know, In a List Report App, how I can get all nodes expanded without having to do it manually on click of Go button, and once all nodes are expanded user can collapse the nodes or keep them as it is.

How can I achieve this functionality?
Please refer screenshot attached for better understanding.
Note: I came across this property : initialExpansionLevel, but not sure how to use it.
 

I have used property :-

 "tableType":"TreeTable" in Manifest.

veronica_09_0-1708366011192.png

 

 

 

 

 

View Entire Topic
Edrilan_Berisha
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Veronica,

 

there is a way how you do this. Once you have fetched your tree table (hopefully you know the ID of that table).

All you need to do is to make use of the numberOfExpandedLevels parameter, when you bind the rows of your tree table:

 

 

 

 oTable.bindRows({
    path: "...",
    parameters: {
      numberOfExpandedLevels: 2 //or if you have even more nodes than two, then just a higher number
    }
  });

 

 

 

 

More information can be found in the official documentation: https://sapui5.hana.ondemand.com/sdk/#/api/sap.ui.table.TreeTable%23methods/Summary

 

Best,

Edrilan Berisha

SAP S/4HANA Cloud Financials Development

veronica_09
Explorer
0 Kudos

Hi Adrilan. Thanks for your input. The app that I have created is list report app and there is no seperate view and controller created for it. So im unable to find the table id, can you please let me know where I can find it, in manifest or anywhere else

 

veronica_09
Explorer
0 Kudos
Hi Edrilan. Thaks for your input. The thing is app that I have created is LIst Report page app and doesnt have any seperate view or controller created, so I am unable to find the table id. Can you please let me know where i can find the table id ,in manifest or anywhre else?