-
27 Oct 2009 1:39 AM #11
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)
-
27 Oct 2009 2:39 AM #12
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!
-
27 Oct 2009 4:08 AM #13
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.
-
27 Oct 2009 4:22 AM #14Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
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); } });
-
27 Oct 2009 4:34 AM #15
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:
instead of:Code:while(p && p != stop){ ctop += Ext.isIE ? Math.abs(p.offsetTop) : p.offsetTop; p = Ext.isIE ? p.parentNode : p.offsetParent; }
Code:while(p && p != stop){ ctop += p.offsetTop; p = p.offsetParent; }
-
27 Oct 2009 6:48 AM #16
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); } });
-
27 Oct 2009 9:57 AM #17
nescha, your soluation works great for me. thanks!



Reply With Quote