SMART datagrid v.1 > Classes > GridBase

Back  Forward

DataLudi.GridBase.getAllRows  method

Parent Row gathers all rows including hidden ones in collapsed state and return as array. 

In Grid View or Tree View which has done row grouping, GridBase.rowCount and getRow do not contain the hidden rows. It can be used to visit all rows including the hidden ones. 

function getAllRows (): [GridRow];
Returns
[GridRow]
Code -1
    $('#calc').click(function () {
        var sum = 0;
        var rows = grid.getAllRows();
        
        for (var i = 0; i < rows.length; i++) {
            var row = rows[i];
            if (row.dataIndex() >= 0) {
                // Get the value to data field name.
                sum += row.getData('SALARY');
            }
        }
        
        $('#sum').val(sum);
    });
See Also
visitRows
GridRow
GridRow.parent
collapsed
GridBase.rowCount
GridBase.getRow
Examples
Row Model Handling
Row Grouping