制表符只显示一页,而有 20+ 页
Tabulator only shows one page, while there are 20+ pages
我正在使用 Tabulator 构建 table:
table = new Tabulator("#smartstat", {
ajaxURL: "https://example.com/getsmartstat/" + date,
pagination: "remote",
paginationSize: 15,
ajaxFiltering: true,
ajaxParams: {_token: "{{ csrf_token() }}"},
ajaxSorting: true,
responsiveLayout: true,
placeholder: "No Data Available",
selectable: true,
layout: "fitColumns",
ajaxProgressiveLoadDelay: 2000,
ajaxConfig: "get",
ajaxResponse:function(url, params, response){
return response.data;
},
columns: [
{title: "Shop", field: "shop", sorter: "string", headerSort: false},
{
title: "Total clicks",
field: "click",
sorter: "number",
align: "center",
formatter: "plaintext"
},
{title: "Plan", field: "plan", sorter: "string", formatter: "html"},
{title: "Limit date", field: "limit_time", formatter: "html", align: "center"},
{title: "Installation Date", field: "timestamp", sorter: "date", align: "center"},
],
});
我得到的响应似乎是正确的(简化示例):
{"last_page":23.266666666666666,"data":[{"shop":"shop1","click":100},{...}]}
所以tabulator理解为总共23页数据,但是我在渲染的时候看到的是这种table分页:
因此只有第一页可用,其他页面的控件将自动禁用。我试图了解我做错了什么。
您的回复似乎有问题,
last_page
应该是一个整数,你不能有23.266666666666666页的table数据
问题是由于 URL 用于包含 Tabulator 已设置为最新版本。因此,从 v2 到 v3 发生了意想不到的更新,因此之前一直正常工作的代码在之后停止工作。为了解决这个问题,我手动回滚到 v2.x
我正在使用 Tabulator 构建 table:
table = new Tabulator("#smartstat", {
ajaxURL: "https://example.com/getsmartstat/" + date,
pagination: "remote",
paginationSize: 15,
ajaxFiltering: true,
ajaxParams: {_token: "{{ csrf_token() }}"},
ajaxSorting: true,
responsiveLayout: true,
placeholder: "No Data Available",
selectable: true,
layout: "fitColumns",
ajaxProgressiveLoadDelay: 2000,
ajaxConfig: "get",
ajaxResponse:function(url, params, response){
return response.data;
},
columns: [
{title: "Shop", field: "shop", sorter: "string", headerSort: false},
{
title: "Total clicks",
field: "click",
sorter: "number",
align: "center",
formatter: "plaintext"
},
{title: "Plan", field: "plan", sorter: "string", formatter: "html"},
{title: "Limit date", field: "limit_time", formatter: "html", align: "center"},
{title: "Installation Date", field: "timestamp", sorter: "date", align: "center"},
],
});
我得到的响应似乎是正确的(简化示例):
{"last_page":23.266666666666666,"data":[{"shop":"shop1","click":100},{...}]}
所以tabulator理解为总共23页数据,但是我在渲染的时候看到的是这种table分页:
因此只有第一页可用,其他页面的控件将自动禁用。我试图了解我做错了什么。
您的回复似乎有问题,
last_page
应该是一个整数,你不能有23.266666666666666页的table数据
问题是由于 URL 用于包含 Tabulator 已设置为最新版本。因此,从 v2 到 v3 发生了意想不到的更新,因此之前一直正常工作的代码在之后停止工作。为了解决这个问题,我手动回滚到 v2.x