【发布时间】:2021-11-09 08:20:12
【问题描述】:
我正在使用 Tabulator 构建表格:
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页数据,但是渲染的时候看到的却是这样的表格分页:
因此只有第一页可用,其他页面的控件会自动禁用。我试图了解我做错了什么。
【问题讨论】:
标签: javascript tabulator