3.2.0

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
August 14,
No, the setScrollTop argument should be vertical offset in pixels, i.e.

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

This topic is archived.

See also:


Back to support forum