Results 1 to 3 of 3

Thread: Reverse numbering for rownumberer

  1. #1
    Sencha User env0ke's Avatar
    Join Date
    Apr 2011
    Posts
    57
    Answers
    2
    Vote Rating
    1
      0  

    Default 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
    10
      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
      0  

    Thumbs up

    Worked for me. Thanks!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •