Results 1 to 4 of 4

Thread: Row numberer not updating when changing page via paging toolbar

Hybrid View

Previous Post Previous Post   Next Post Next Post
    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-9183 in 4.2.1.883.
  1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    2
    Vote Rating
    1
      1  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,411
    Vote Rating
    1290
      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
    1,017
    Vote Rating
    125
      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);
    Object.NET
    Frameworks and Tools for .NET Developers
    --------------------------------------------------
    Ext.NET - Ext JS for ASP.NET - Examples | Twitter
    Bridge.NET - Write C#. Run JavaScript! - Live | Twitter
    --------------------------------------------------

  4. #4
    Sencha User
    Join Date
    May 2012
    Posts
    2
    Vote Rating
    1
      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

Posting Permissions

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