diff --git a/src/tree-grid-directive.js b/src/tree-grid-directive.js index 08d514b..8b7c2b8 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 = level < target_level; + }); + }; tree.collapse_all = function () { return for_each_branch(function (b, level) { return b.expanded = false;