From c4f7349b979382f0427604286cfccc96215ba9ef Mon Sep 17 00:00:00 2001 From: mgallo Date: Wed, 12 May 2021 14:45:30 +0200 Subject: [PATCH 1/2] Added a feature to expand the grid till a target level --- src/tree-grid-directive.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tree-grid-directive.js b/src/tree-grid-directive.js index 08d514b..fe8189c 100644 --- a/src/tree-grid-directive.js +++ b/src/tree-grid-directive.js @@ -446,6 +446,11 @@ return b.expanded = true; }); }; + tree.expand_until_level = function (target_level) { + return for_each_branch(function (b, level) { + return b.expanded = target_level < level; + }); + }; tree.collapse_all = function () { return for_each_branch(function (b, level) { return b.expanded = false; From ada3bf02a78132b07c2506db5ed75cbfe871dcc9 Mon Sep 17 00:00:00 2001 From: mgallo Date: Wed, 12 May 2021 14:59:31 +0200 Subject: [PATCH 2/2] swapped condition --- src/tree-grid-directive.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tree-grid-directive.js b/src/tree-grid-directive.js index fe8189c..8b7c2b8 100644 --- a/src/tree-grid-directive.js +++ b/src/tree-grid-directive.js @@ -448,7 +448,7 @@ }; tree.expand_until_level = function (target_level) { return for_each_branch(function (b, level) { - return b.expanded = target_level < level; + return b.expanded = level < target_level; }); }; tree.collapse_all = function () {