TreeGrid collapse all doesn't work


First of all, the collapse all method only collapse the first level.

How can I set my json data to trigger which groups should collapse?

My dataset has three tiers, Credit Card Group -> Credit Card Category -> Merchant.


I wrote my own function to collapse a tree on all levels, it is a recursive function.

The issue with the collapseAll. Since it goes in order of the children, it will not collapse the sub node when the parent already is collapsed. (When you collapse in order, it skips the sub nodes of that child node)

So my function will go to the lowest tier and collapse upwards. Until it gets back to the root.

just call using
var treegrid = new dhx.TreeGrid("#treeGrid", {…});

    function collapseTree(treeGrid, parentId) {
        if (parentId == undefined) {
            parentId =;
        }, function (_a) {
            if (_a.parent == parentId && {


Thank you for your report.
This is known problem and it will be fixed in the next dhtmlxSuite update.


We have fixed that problem in the latest dhtmlxSuite update.
Now the collapseAll() method should work correctly.