📜  easyui datagrid scrollto - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:59.708000             🧑  作者: Mango

代码示例1
// since 1.3.3
var dg = $('#dg');
var indexToFetch = 88;

// scroll to index (without pagination)
dg.datagrid('scrollTo', indexToFetch);

// scroll to index (using pagination)
var pager = dg.datagrid('getPager');
const pageSize = pager.pagination('options').pageSize;
const pageIndex = Math.ceil( indexToFetch / pageSize );
pager.pagination('select', pageIndex);
dg.datagrid('scrollTo', indexToFetch % (pageSize + 1));