扩展RowNumberer

GridPanel翻页后行号都从1开始,扩展后按翻页的行号计算:

Ext.ux.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
    renderer: function (v, p, record, rowIndex) {
        var start = record.store.lastOptions.params.start;
        if (this.rowspan) {
            p.cellAttr = 'rowspan="' + this.rowspan + '"';
        }
        return start + rowIndex + 1;
    }
});

你可能感兴趣的:(ext)