You found a bug! We've classified it as EXTJSIV-9183 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    2
    Vote Rating
    1
    jaredhobbs is on a distinguished road

      1  

    Default Row numberer not updating when changing page via paging toolbar

    Row numberer not updating when changing page via paging toolbar



    Ext version tested:
    • Ext 4.2.0
    Browser versions tested against:
    • Chrome 27.0.1438.7 dev
    Description:
    • When using a grid with a rownumberer column and the paging toolbar in 4.2.0, the row numbers aren't being updated when changing pages. For example, with 50 pages displayed, the row numberer shows 1-50. If you switch to page 2, instead of seeing 51-100 you see 1-50.
    Steps to reproduce the problem:
    • Add a row numberer to a grid with a paging toolbar then change to another page
    The result that was expected:
    • I expect the row numberer to display 51-100
    The result that occurs instead:
    • The row numberer displays 1-50
    Test Case:
    • Add
      Code:
      {xtype:'rownumberer'}
      to the columns array in
      Code:
      examples/grid/paging.js
      then open the example and click the "next page" button on the paging toolbar.

    Possible fix:
    Code:
    Ext.override(Ext.grid.RowNumberer, {
        renderer: function(value, metaData, record, rowIdx, colIdx, store) {
            var rowspan = this.rowspan;
            if (rowspan) {
                metaData.tdAttr = 'rowspan="' + rowspan + '"';
            }
            metaData.tdCls = Ext.baseCSSPrefix + 'grid-cell-special';
            return store.indexOfTotal(record) + 1;
        }
    });
    Operating System:
    • OS X 10.8.3
    Last edited by jaredhobbs; 18 Mar 2013 at 11:13 AM. Reason: Added fix

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,582
    Vote Rating
    434
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    Thanks for the report! I have opened a bug in our bug tracker.

  3. #3
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    678
    Vote Rating
    62
    Daniil is a jewel in the rough Daniil is a jewel in the rough Daniil is a jewel in the rough Daniil is a jewel in the rough

      0  

    Default


    Hi @jaredhobbs,

    Thank you for a possible fix. Though it breaks if use a grouping feature.

    A possible fix of your fix is replacing:
    Code:
    return store.indexOfTotal(record) + 1;
    with
    Code:
    return store.indexOfTotal ? (store.indexOfTotal(record) + 1) : (rowIdx + 1);
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

  4. #4
    Sencha User
    Join Date
    May 2012
    Posts
    2
    Vote Rating
    1
    jaredhobbs is on a distinguished road

      0  

    Default


    Thanks for your fix of my fix. I haven't used the grouping feature with a paging toolbar before so didn't catch that case.

Tags for this Thread