SMART datagrid v.1 > Classes > GridBase

Back  Forward

DataLudi.GridBase.visitRows  method

被用于访问包含collapsed状态的行的所有行。 

在已进行行分组的网格视图树视图GridBase.rowCountgetRow将不会包含隐藏行。 如果调用这个方法,就会在每次访问包含隐藏行的所有行时,调用callback函数。 

function visitRows (visibleOnly: boolean, dataOnly: boolean, callback: function);
Returns
Void
Parameters
visibleOnly - boolean. 默认值为false.
只访问显示中的行。
dataOnly - boolean. 默认值为false.
只访问dataIndex大于0的数据行。
callback - function.
function (row:GridRow, count:Integer, index:Integer);
Code -1
    // 获取所有行。
    var rows;

    $('#collectRows').click(function () {
        rows = [];
        grid.visitRows(false, false, function (row, count, i) {
            rows.push(row);
        });
    });
See Also
getAllRows
GridRow
GridRow.parent
collapsed
GridBase.rowCount
GridBase.getRow
Examples
操作行模型
行分组