Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

sapui5 - sap.ui.table.TreeTable: How to expand all nodes with a single click optimally?

I have a tree table and would allow my users to expand all nodes with a click on a single button.

I can currently achieve this via two approaches:

oTreeTable.expandToLevel(999);

or

oTreeTable.bindRows({
  path: sPath + "/to_ClosingHierarchyNode",
  parameters: {
    numberOfExpandedLevels: 999
  }
});

Unfortunately, performance is pretty bad whenever the tree involves deep hierarchies as for every folder single requests (bundled in one batch call) are fired.

I would like to see a function like .expandAll(), which only fires one request (regardless if some nodes are already expanded, etc.). I know this will come with other drawbacks but from a performance perspective, this is the fastest solution.

Is it possible to somehow achieve this? The only way I can think of is a JSON model and handle the rebinding, etc. by myself, but I would rather go with OData and annotations. Does anyone have an idea?

question from:https://stackoverflow.com/questions/66062807/sap-ui-table-treetable-how-to-expand-all-nodes-with-a-single-click-optimally

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...