<html>
<head>
<script src="aw.js"></script>
<link href="aw.css" rel="stylesheet" type="text/css" />
<script>
var tbl = new AW.UI.Grid;
tbl.setColumnCount(1);
tbl.setRowCount(100000);
tbl.setCellText(function(c,r){return getCellText(tbl, r, c)});
document.write(tbl);
function getCellText (tbl, row, col) {
return 'row:' + row;
}
</script>
</head>
<body>
</body>
</html>
AW.Grid.Controllers.Virtual ...
function getMult() {
if (!AW.ie8)
return 1;
var scrollHeight = this.getScrollHeight();
var bs = this.getScroll().getContent("box/spacer").element();
if (bs && bs.clientHeight && bs.clientHeight < scrollHeight)
return scrollHeight / bs.clientHeight;
return 1;
}
function calcVirtual(dir){
...
var scrollTop = this.getScrollTop();
var mult = getMult.call(this);
scrollTop = Math.round(scrollTop * mult);
var scrollLeft = this.getScrollLeft();
...
var rvScroll = start * rowHeight;
rvScroll = Math.round(rvScroll / mult);
...
}
onCurrentRowChanged: function(i){
var current=this.getCurrentRow();
var scroll=this.getScrollProperty("top");
var mult = getMult.call(this);
scroll = Math.round(scroll * mult);
...
if(top < scroll){
this.setScrollTop(Math.floor(top/mult));
}
if(max+scroll < bottom){
this.setScrollTop(Math.ceil((bottom - max)/mult));
}
...
}
function getMult() {
if (!AW.ie8)
return 1;
var scrollHeight = this.getScrollHeight();
var bs = this.getScroll().getContent("box/spacer").element();
if (bs && bs.clientHeight && bs.clientHeight < scrollHeight) {
var visHeight = this.getContentHeight("center");
return (scrollHeight-visHeight)/(bs.clientHeight-visHeight);
}
return 1;
}
function getMult() {
if (!AW.ie8)
return 1;
var scrollHeight = this.getScrollHeight();
var bs = this.getScroll().getContent("box/spacer").element();
if (bs && bs.clientHeight && bs.clientHeight < scrollHeight) {
var boxHeight = bs.parentNode.offsetHeight;
return (scrollHeight-boxHeight)/(bs.clientHeight-boxHeight);
}
return 1;
}
This topic is archived.