Results 1 to 2 of 2

Thread: [FIXED][3.0RC3] Gridview ensurevisible bug

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext JS Premium Member
    Join Date
    May 2007
    Location
    Aalborg, Denmark
    Posts
    16

    Default [FIXED] [3.0RC3] Gridview ensurevisible bug

    Ext version tested:

    • Ext 3.0 rev RC3



    Browser versions tested against:

    • FF3.5




    Operating System:

    • WinXP Pro




    Description:

    • Calling focusRow in gridview doesn't always show the row. Looking at the code in ensureVisible explains why.




    Test Case:

    gridview.js function ensureVisible from 3.0RC3
    Code:
    ...
           var rowEl = resolved.row, 
                cellEl = resolved.cell,
                c = this.scroller.dom,
                ctop = 0,
                p = rowEl,          
                stop = this.el.dom;
                
            while(p && p != stop){
                ctop += p.offsetTop;
                p = p.offsetParent;
            }
            ctop -= this.mainHd.dom.offsetHeight;
    
            var cbot = ctop + rowEl.offsetHeight,
                ch = c.clientHeight,
                sbot = stop + ch;
                
            stop = parseInt(c.scrollTop, 10);
    
            if(ctop < stop){
              c.scrollTop = ctop;
            }else if(cbot > sbot){
                c.scrollTop = cbot-ch;
            } 
    ...
    Notice how the variable stop is assigned an object, and that the variable sbot is the result of adding a number to that object, and then stop is assigned a number. This doesn't make any sense.


    gridview.js function ensureVisible from 2.2.1
    Code:
    ...
            var p = rowEl, stop = this.el.dom;
            while(p && p != stop){
                ctop += p.offsetTop;
                p = p.offsetParent;
            }
            ctop -= this.mainHd.dom.offsetHeight;
    
            var cbot = ctop + rowEl.offsetHeight;
    
            var ch = c.clientHeight;
            var stop = parseInt(c.scrollTop, 10);
            var sbot = stop + ch;
    ...
    Notice how stop is first converted into a number before it is used in the creation of sbot.

  2. #2
    Sencha Premium User
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258

    Default

    Fixed in SVN, thanks.

Posting Permissions

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