制表符:如何在任意页面上启动远程分页

Tabulator: how to start remote pagination on arbitrary page

我对 Tabulator 上的远程分页与自动 ajax 加载的工作方式非常满意,但我似乎无法找到一种方法来设置 table 首先加载。 table.setPage(pageNum) 仅在获取并呈现第一页后才对我有用;如果我做类似

的事情
new Tabulator("#my-tabular-table", { lots of stuff }).setPage(5)

然后我得到 Pagination Error - Requested page is out of range of 1 - 1:,因为尚未从服务器收到页数。

有什么办法吗?我错过了什么吗?我意识到我可以挂钩一些回调并在加载第一页后立即切换到所需的页面,但我不想等待额外的服务器调用。

您可以在 table 定义中使用 paginationInitialPage 选项来设置初始加载的页码:

var table = new Tabulator("#example-table", {
    pagination:"remote", //enable remote pagination.
    paginationInitialPage:2, // this option can take any positive integer value
});