Collapses all nodes and performs the drill-up of all hierarchies in the slice on the grid and on charts. All expanded or drilled-down nodes will become collapsed or drilled-up, respectively.

Example

webdatarocks.collapseAllData();

Check out the CodePen example.

More information