Threaded View

  1. #1
    Sencha User env0ke's Avatar
    Join Date
    Apr 2011
    Posts
    57
    Vote Rating
    1
    Answers
    2
    env0ke is on a distinguished road

      0  

    Default Answered: Reverse numbering for rownumberer

    Answered: Reverse numbering for rownumberer


    Hi all,

    How i can do reverse numbering for rownumberer?

  2. Quote Originally Posted by env0ke View Post
    Hi all,

    How i can do reverse numbering for rownumberer?
    Try defining:

    Code:
    Ext.define('Ext.ux.grid.ReverseRowNumberer', {
        extend: 'Ext.grid.RowNumberer',
        alias: 'widget.reverserownumberer',
    
    
        renderer: function(value, metaData, record, rowIdx, colIdx, store) {
            if (this.rowspan){
                metaData.cellAttr = 'rowspan="'+this.rowspan+'"';
            }
    
    
            metaData.tdCls = Ext.baseCSSPrefix + 'grid-cell-special';
    
            // reverse the direction of the returned row number by subtracting it off the total
            return store.totalCount - store.indexOfTotal(record) + 1;
        }
    });
    and use xtype: 'reverserownumberer' for your row numberer column.

    hope this gets you started.

    stevil

Thread Participants: 1

Tags for this Thread