SMART datagrid v.1 > Examples

Back  Forward

Visit Children  Example
no-lite

Since Rows of TreeView are organized hierarchically, we need a special way to approach all descendants. In the example below, it uses GroupRow.visitAll and visit methods to change the checked state of the descendants the same when the row is checked. 

Tree - 1
rows

GroupRow.visitAll enables to run the specified callback function in all descendants, and visit enables to visit descendants of the specified level. 

Please change the checked state of the top row of tree view with alternating below selections. 

Code -1
    var visiting = false;
    treeMain.onRowChecked = function (grid, row, checked) {
        if (!visiting) {
            visiting = true;
            row.visitAll(function (child) {
                grid.setChecked(child, checked);
            });
        }
    };

View Source JSP 

See Also
GroupRow.visitAll
GroupRow.visit
TreeView
TreeRow
Examples
Tree Editing