:: Forum >>

Scrolling in grid in Firefox causes the whole page to scroll to the top

I have a grid at the bottom of a page. You have to scroll the page down to see the whole grid. When you scroll up or down in the grid, the whole page scrolls to the top. It's almost like the whole page got a refresh or something. The grid still scrolls, but you have to scroll back down to the grid in the page to see it.

This seems to work fine in IE, but not FireFox. Any suggestions?
Maggie M
Tuesday, September 5, 2006
I noticed this too. Did you find a work around?
Michael Klocker
Friday, September 8, 2006
No I haven't been able to find a fix for it yet. The grid example on the main page of ActiveWidgets doesn't have the same issue. I don't know if that's because that uses iframes where I'm using div tags.
Maggie M
Monday, September 11, 2006
The only thing I've found out so far, is that it seems that when I scroll in the grid that in Firefox it's also doing a window.onscroll but in IE it doesn't do a window.onscroll. I'm going to look at the eventhandlers and see if I can figure something out in there.
Maggie M
Tuesday, September 12, 2006
Yes, I can reproduce this and somehow this problem is related to the virtual mode (rows refresh) and not the scrolling itself. For small grids it can be fixed with setVirtualMode(false).

I'll keep looking for the correct solution.
Alex (ActiveWidgets)
Tuesday, September 12, 2006
I poked around in the rows.js and think it has to do with the section...
obj.refresh=function(){
        try{
            if(this.$owner.$active){
                var e=this.$owner.getContent("focus").element();
                if(AW.ie){
                    var r=document.body.createTextRange();
                    r.moveToElementText(e);
                    r.select();
                    r=null
                }
                e.focus();
                e=null
            }
        }
        catch(err){}
        if(typeof(this.$0)=="undefined" && this.$owner.$extended){
            for(var i=0;i<3;i++){
                _super.refresh.call(this.$owner.getRowsTemplate(i))
            }
        }
        else{_super.refresh.call(this)}
    }

I think it's not finding the "e" element. If I comment out e.focus(), the whole page in Firefox doesn't try to scroll to the top. But I don't want to leave it that way in case it messes up something else.
Maggie M
Tuesday, September 12, 2006
Seems like if I just comment out e.focus(), that I get weird flickering (trying to still load the grid) behaviour. Instead I did the following...
if(this.$owner.$active){
var e=this.$owner.getContent("focus").element();
if((e!='')&&(e!="undefined")&&(e!=null)){
if(AW.ie){
var r=document.body.createTextRange();
r.moveToElementText(e);
r.select();
r=null
}
e.focus()
} else {
this.focus()
}
e=null
}


Not sure if this is correct, but seems to solve the issues I was having with scrolling in Firefox.
Maggie M
Wednesday, September 13, 2006
I take that back...don't need the else { this.focus() }
darn caching :)
The flickering issues were already there prior to me changing any aw code. I think that has to do with me including images in the grid not by the AW.Templates.Image, but by using img tags since I needed tooltips and click thrus for those images.
Maggie M
Wednesday, September 13, 2006
is there a fix to this yet? i tried comenting out the e.focus() and it still does not work on me. thanks
heidit
Friday, January 5, 2007
The current fix is adding the following CSS -

.aw-gecko .aw-grid-focus {
position: relative;
}


http://www.activewidgets.com/javascript.forum.16621.6/page-scrolls-to-top-when.html

Some people reported that this fix does not work but I was not able to reproduce it so far (works always for me). If it does not - please send me an example.
Alex (ActiveWidgets)
Friday, January 5, 2007

This topic is archived.


Back to support forum

Forum search