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;
}
}
}
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,