I'm building a table with 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"},
],
});
The response I get seems to be correct (shortened example):
{"last_page":23.266666666666666,"data":[{"shop":"shop1","click":100},{...}]}
So tabulator understands that there are 23 pages of data in total, but what I see when it is rendered is this kind of table pagination:
So only the first page is available, and controls for other pages are automatically disabled. I am trying to understand what I'm doing wrong.
It looks like there is an issue with your response,
The last_page should be an integer, you cannot have 23.266666666666666 pages of table data
The problem was caused by the fact that URL used to include the Tabulator has been set to latest version. So, unexpected update happened from v2 to v3, and thus the code that have been working properly before, stopped working after. To fix that, I've manually rolled back to v2.x