3.2.0

Vertical scrollbar problem on resizing grid

Hi,

When I resize the grid such that the number of visible rows reduce, the vertical scrollbar doesn't appear.
In the example code below, initially I have 7 columns.
I have set a timeout which will resize the grid to half its height in 5 seconds.
In FireFox, Opera and Safari, there is no vertical scrollbar after resizing.
It works as expected in IE7.
Any ideas ?

Ankur

<html>
<head>
    <script src="runtime/lib/aw.js"></script>
    <link href="runtime/styles/xp/aw.css" rel="stylesheet"></link>
</head>
<body>
<script>
var obj = new AW.Grid.Extended;
obj.setCellText(function(i, j){return j + "." + i});
obj.setHeaderText("header");

obj.setFixedLeft(0);

obj.setColumnCount(10);
obj.setRowCount(7);
obj.setSize(400, 200);

document.write(obj);

window.setTimeout(function(){obj.setSize(400, 100);}, 5000);
</script>
</body>
</html>
Ankur Motreja
March 1,
Just need a final rendering scroll adjustments ,
try :

window.setTimeout(function(){obj.setSize(400, 100);
obj.raiseEvent("adjustScrollHeight");
//obj.raiseEvent("adjustScrollWidth"); 
obj.raiseEvent("adjustScrollBars"); 
}, 5000);

Carlos
March 1,
Hi Carlos,

No, that doesn't work.
The vertical scrollbars are still missing.
By the way, the activewidgets version I'm using is 2.5.1
Ankur Motreja
March 1,
Thanks Ankur,
You'r more than right! ( sorry my bad, I only test that under IE6 ).

Found that adding obj.setScrollBars('both'); fix current test, but it's not an "exact" workaround cause need a proper calculation to know if , after a size change, the vertical ( or horizontal) scrollbar need to be painted.

It would need a complete width+height - ScrollTemplate recalc+setting ( unless if,as always, Alex have found the "short" fixfor the case) :)
Best
Carlos
March 2,
Ankur,
This post is related ( and Alex already did a short-temporary-workaround :o ), and seems to solve it ( tested on FF 2.0.011 ) will be corrected in the next bug-fix release.
HTH

http://www.activewidgets.com/javascript.forum.21650.4/dynamic-height-on-a-data.html
Carlos
March 3,
Hi Carlos,

Thank you !!
That works.

Ankur
Ankur Motreja
March 3,
Hi,

Oops, posted too soon :)
I had obj.setScrollBars('both') set at multiple places and it was working due to that.
The solution at http://www.activewidgets.com/javascript.forum.21650.4/dynamic-height-on-a-data.html doesn't seem to work for this case.
Carlos, are you sure it was working for you (I used FF 2.0.0.12, but I don't think that should make much of a difference) ?

In any case, obj.setScrollBars('both') seems to work in this case.
Maybe Alex will fix this issue in the next release.
Thanks Carlos.

Ankur
Ankur Motreja
March 3,
Ankur, This is the testing code I am using:

obj.paint = function(){ 
    var h = this.getScrollTemplate().element().offsetHeight; 
    this.setTimeout(function(){ 
        this.setContentHeight(h, "total"); 
        this._virtualController.paint.call(this); 
    }); 
} 
document.write(obj);
window.setTimeout(function(){obj.setSize(400, 100);obj.paint() }, 5000);
Carlos
March 4,
Hi Carlos,

I missed out the obj.paint() call in setTimeout and so it was obviously not working.
Its working fine now.
Thank you very much for all your help.

Thanks,
Ankur
Ankur Motreja
March 5,

This topic is archived.

See also:


Back to support forum