:: Forum >>

setScrollTop(i) doesn't scroll row i to the top

I want to select a row and scroll the selected row to the top. Somehow, the scrollTop doesn't work; it doesn't scroll the selected row to the top. Am I using the method correctly here?

function lookupItem(prefix, srcGrid) {
var found = false;
var selected=new Array();
for(i=0; i<srcGrid.getRowCount(); i++){
found = (srcGrid.getCellData(1, i).indexOf(prefix)==0);
if(found){
selected[0] = i;
srcGrid.setSelectedRows(selected);
srcGrid.setScrollTop(i);
break;
}
}
}
qw
Tuesday, August 14, 2007
No, the setScrollTop argument should be vertical offset in pixels, i.e.

grid.setScrollTop(i*20);
Alex (ActiveWidgets)
Tuesday, August 14, 2007

This topic is archived.


Back to support forum

Forum search