1. #1
    Sencha User env0ke's Avatar
    Join Date
    Apr 2011
    Posts
    57
    Answers
    2
    Vote Rating
    1
    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

  3. #2
    Ext JS Premium Member stevil's Avatar
    Join Date
    Nov 2007
    Location
    Denver, CO
    Posts
    1,045
    Answers
    15
    Vote Rating
    9
    stevil will become famous soon enough

      0  

    Default


    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

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

      0  

    Thumbs up


    Worked for me. Thanks!

Thread Participants: 1

Tags for this Thread