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

Viewed 505

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?

0 Answers
Related