Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: erratic grid behavior after scrolling down and selecting a row in IE8

  1. #11
    Sencha User
    Join Date
    May 2008
    Posts
    27
    Vote Rating
    0
      0  

    Default

    One more vote to make Ext support and developers pay more attention to this problem. We are using Ext 2.2 but same behavior occurs even for Ext examples when in full IE8 mode (Browser mode: IE8, Document Mode: IE8 Standards)

    Quote Originally Posted by miti View Post
    I have this issue with Ext2 as well. We just upgraded to Ext3 yesterday and the issue is still there. And the ensureVisible fix doesn't fix the problem. This is an IE8 specific issue. Thanks.

  2. #12
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,428
    Vote Rating
    858
      0  

    Default

    Once again, I'm not seeing this behaviour. Can someone describe the problem further?
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #13
    Sencha User
    Join Date
    May 2008
    Posts
    27
    Vote Rating
    0
      0  

    Default

    Sure thing, access http://www.extjs.com/deploy/dev/exam...rray-grid.html from IE8 with Browser mode: IE8, Document Mode: IE8 Standards. Scroll down a bit (so scroller is in the mid of bottom half), select one row. Selected row will scroll downso it becomes first row at the bottom that ain't visible.

    Quote Originally Posted by evant View Post
    Once again, I'm not seeing this behaviour. Can someone describe the problem further?

  4. #14
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    118
      0  

    Default

    It still think it is this bug (both Ext 2.3 and 3.0.0 are wrong).

    Ext 3.0.1 and up contain the corrected code:
    Code:
    Ext.override(Ext.grid.GridView, {
        ensureVisible : function(row, col, hscroll){
            var resolved = this.resolveCell(row, col, hscroll);
            if(!resolved || !resolved.row){
                return;
            }
            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;
            stop = parseInt(c.scrollTop, 10);
            var cbot = ctop + rowEl.offsetHeight,
                ch = c.clientHeight,
                sbot = stop + ch;
            if(ctop < stop){
              c.scrollTop = ctop;
            }else if(cbot > sbot){
                c.scrollTop = cbot-ch;
            }
            if(hscroll !== false){
                var cleft = parseInt(cellEl.offsetLeft, 10);
                var cright = cleft + cellEl.offsetWidth;
                var sleft = parseInt(c.scrollLeft, 10);
                var sright = sleft + c.clientWidth;
                if(cleft < sleft){
                    c.scrollLeft = cleft;
                }else if(cright > sright){
                    c.scrollLeft = cright-c.clientWidth;
                }
            }
            return this.getResolvedXY(resolved);
        }
    });

  5. #15
    Sencha User
    Join Date
    May 2008
    Posts
    27
    Vote Rating
    0
      0  

    Default

    Well, if you managed to reproduce bug at your example pages, plz do inspect:
    http://www.extjs.com/deploy/dev/ext-all-debug.js
    http://www.extjs.com/deploy/dev/ext-all.js

    Both of them include your mentioned fix.

    Part in ensureVisible (Ext 2.2) that can do the trick is:
    Code:
                while(p && p != stop){
                    ctop += Ext.isIE ? Math.abs(p.offsetTop) : p.offsetTop;
                    p = Ext.isIE ? p.parentNode : p.offsetParent;
                }
    instead of:
    Code:
            while(p && p != stop){
                ctop += p.offsetTop;
                p = p.offsetParent;
            }
    Quote Originally Posted by Condor View Post
    It still think it is this bug (both Ext 2.3 and 3.0.0 are wrong).

    Ext 3.0.1 and up contain the corrected code:
    Code:
    Ext.override(Ext.grid.GridView, {
        ensureVisible : function(row, col, hscroll){
           ...
        }
    });

  6. #16
    Sencha User
    Join Date
    May 2008
    Posts
    27
    Vote Rating
    0
      0  

    Default

    Previous fix doesn't work.

    This one should be better:
    Code:
    Ext.override(Ext.grid.GridView, {
        ensureVisible : function(row, col, hscroll){
            var resolved = this.resolveCell(row, col, hscroll);
            if(!resolved || !resolved.row){
                return;
            }
            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;
            ctop -= Ext.isIE8 && (0 > this.mainBody.dom.offsetTop) ? this.mainBody.dom.offsetTop : 0;
            stop = parseInt(c.scrollTop, 10);
            var cbot = ctop + rowEl.offsetHeight,
                ch = c.clientHeight,
                sbot = stop + ch;
            if(ctop < stop){
              c.scrollTop = ctop;
            }else if(cbot > sbot){
                c.scrollTop = cbot-ch;
            }
            if(hscroll !== false){
                var cleft = parseInt(cellEl.offsetLeft, 10);
                var cright = cleft + cellEl.offsetWidth;
                var sleft = parseInt(c.scrollLeft, 10);
                var sright = sleft + c.clientWidth;
                if(cleft < sleft){
                    c.scrollLeft = cleft;
                }else if(cright > sright){
                    c.scrollLeft = cright-c.clientWidth;
                }
            }
            return this.getResolvedXY(resolved);
        }
    });
    Quote Originally Posted by nescha View Post
    Well, if you managed to reproduce bug at your example pages, plz do inspect:
    http://www.extjs.com/deploy/dev/ext-all-debug.js
    http://www.extjs.com/deploy/dev/ext-all.js

    Both of them include your mentioned fix.

    Part in ensureVisible (Ext 2.2) that can do the trick is:
    Code:
                while(p && p != stop){
                    ctop += Ext.isIE ? Math.abs(p.offsetTop) : p.offsetTop;
                    p = Ext.isIE ? p.parentNode : p.offsetParent;
                }
    instead of:
    Code:
            while(p && p != stop){
                ctop += p.offsetTop;
                p = p.offsetParent;
            }

  7. #17
    Ext JS Premium Member
    Join Date
    Oct 2007
    Posts
    89
    Vote Rating
    2
      0  

    Default

    nescha, your soluation works great for me. thanks!

Page 2 of 2 FirstFirst 12

Posting Permissions

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