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
M-A-R-C
Explorer
0 Kudos

Hey, I was not really satisfied with the other answer. Why would you manually call bindRows in a Fiori Elements application?

I did some digging, there is the property initialExpansionLevel which you mentioned. The sample from SAP was a little too complicated (probably) and I had to remove some lines to get it to work. Basically you just have to add the following presentation variant in your metadata extension (or wherever).

 

@ui.presentationVariant: [{
  visualizations: [
      {
        type: #AS_LINEITEM
      }
    ],
  initialExpansionLevel: 3
}]

In the most simple case you don't have to add qualifiers etc. Just these few lines.