需要搜索应该使用 dataTable 插件从服务器端进行

Need search should happen from server side using dataTable plugin

我正在使用 DataTable 插件。目前,正在根据列表中的可用数据进行搜索。我需要在搜索框中输入值时从服务器端获取数据并显示在列表中。请给我建议合适的方法。

这是 DataTables 内置的。看看这里的例子: https://www.datatables.net/examples/data_sources/server_side.html

从上面link:

With server-side processing enabled, all paging, searching, ordering actions that DataTables performs are handed off to a server where an SQL engine (or similar) can perform these actions on the large data set (after all, that's what the database engine is designed for!). As such, each draw of the table will result in a new Ajax request being made to get the required data.

使用 serverSide 设置和它应该调用的 ajax 数据端点的路径进行初始化

$('#example').dataTable( {
    "processing": true,
    "serverSide": true,
    "ajax": "../server_side/scripts/server_processing.php"
} );

然后,您编写的服务器端代码将获取参数,适当地搜索数据库,然后以 JSON 编码结果响应,供 DataTables 使用并用于重绘 table