SMART datagrid v.1 > Classes > GroupRow

Back  Forward

DataLudi.GroupRow.visitAll  method

Callback function specified in callback parameter runs in all descendant rows. 

If want to run only in descendant rows of specific level, you can use visit

function visitAll (callback: Function);
Returns
Void
Parameters
callback - Function. required.

function (row:GridRow, count:Integer, index:Integer):Boolean;

Code -1
    // When the tree row has been checked/unchecked, it will also change checked state of all descendant rows.
    var visiting = false;
    treeMain.onRowChecked = function (grid, row, checked) {
        if (!visiting) {
            visiting = true;
            row.visitAll(function (child) {
                grid.setChecked(child, checked);
            });
            visiting = false;
        }
    };
See Also
visit
GridBase.setChecked
GridRow.checked
Examples
Visit Children