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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…