Tree/grid exposed level

Is there a function which expands/collapses a tree to a specified level? E.g. myTreeGrid.showNodesToLevel(2) which would only show the tree nodes up to the 3rd level (automically collapsing/expanding as necessary).

Nope, unfortunately there is no such function, but next code can be used for the same task

if (el.level == 1)