3.2.0

Grid Auto-Scroll

Hi,
i am having a grid, which displays 20 rows. But my view shows only 5 rows at a time. i want row # 10 to be highlighted and shown in the view (in an pre-scroll mode) when the page refreshes. I am using ActiveWidgets version 1.0.2. I saw the following code in this forum, but this doesn't work


function scrollIntoView(index){

var row = this.getTemplate("row", index);
var data = this.getTemplate("layout").getContent("data");
var left = this.getTemplate("layout").getContent("left");
var scrollbars = this.getTemplate("layout").getContent("scrollbars");

try {
var top, padding = parseInt(data.element().currentStyle.paddingTop);
if (data.element().scrollTop > row.element().offsetTop - padding) {
top = row.element().offsetTop - padding;
left.element().scrollTop = top;
data.element().scrollTop = top;
scrollbars.element().scrollTop = top;
}

if (data.element().offsetHeight + data.element().scrollTop <
row.element().offsetTop + row.element().offsetHeight ) {
top = row.element().offsetTop + row.element().offsetHeight - data.element().offsetHeight;
left.element().scrollTop = top;
data.element().scrollTop = top;
scrollbars.element().scrollTop = top;
}
}
catch(error){
// ignore errors
}
}



Please help.
Vijayakumar OA
July 21,

This topic is archived.

See also:


Back to support forum