$viewport.scrolltop
グリッドへの参照を取得して gridsメソッドを呼び出す必要があると思います。注: 私はこれをテストしませんでした。私が行ったことに基づいて同様のことを書いただけです。
plugins: [{
onGridInit: function (g) {
// maybe add a method to your view model
viewModel.scrollTo = function (index, key) { // index of item in filter data, key is something i made up
if (index > g.filteredData().length - 8) { // 8 is the default excess_rows value in kogrid
g.$viewport.scrollTop(g.$viewport.scrollTop() + (g.config.rowHeight * index));
}
// if you want to select the row (set time out because ko grid dynamically creates the rows rendered in the grid)
setTimeout(function () {
var i = ko.utils.arrayFirst(g.renderedRows(), function (row) {
// some function that finds the entity
return row.entity.key === key;
});
if (i) {
g.selectionService.ChangeSelection(i) // this will select the row
}
}, 100);
}// assume self is your view model
}
}]