【发布时间】:2022-04-11 22:20:02
【问题描述】:
我正在尝试使用数据表插件进行 ajax 分页。它加载了第一组数据,但分页不起作用。 有人可以给我一个数据表ajax分页的好例子吗?
我还需要知道如何设置要显示的行数。
【问题讨论】:
-
在这里发布您的代码。我需要您到目前为止尝试过的内容..
标签: php datatables jquery-pagination
我正在尝试使用数据表插件进行 ajax 分页。它加载了第一组数据,但分页不起作用。 有人可以给我一个数据表ajax分页的好例子吗?
我还需要知道如何设置要显示的行数。
【问题讨论】:
标签: php datatables jquery-pagination
您需要创建一个 AJAX 端点(数据库将从这里填充表)。
以下 JSON 数据应来自数据表。
iTotalRecords – Number of total records in the table, before applying the filters.
iTotalDisplayRecords – Number of records returned after applying the filters.
sEcho – An un-altered copy of the sEcho sent from the client.
aaData – Array of data from the server.
【讨论】: