gpt4 book ai didi

javascript - 为什么服务器端 DataTable 上的 rows() 不是函数?

转载 作者:行者123 更新时间:2023-12-03 10:32:26 25 4
gpt4 key购买 nike

为什么rows()不是服务器端数据表上的函数?

除此之外,表格工作正常。

我之前曾在其他五个客户端数据表上使用过 rows() ,没有任何问题。

var tableComputerAndDevice = $('#tableComputerAndDevices').dataTable({
searching: true,
processing: true,
serverSide: true,
language: {
"processing": '<div style="background-color:#eee"> <span class="fa fa-spinner fa-pulse fa-5x"> </span> </div>'
},
ajax: {
url: url,
data: data,
type: "POST"
},
columns: [
{ "data": "checkbox", "searchable": false },
{ "data": "ComputerName", "searchable": true },
{ "data": "LastContact", "searchable": true }
]
});

var nodes = tableComputerAndDevice.rows('.selected').nodes();
console.log('nodes: ' + nodes);

错误: TypeError:tableComputerAndDevice.rows 不是函数

最佳答案

是的,你判断正确。您需要将 dataTable 更改为 DataTable

还要说明 dataTable 和 DataTable 之间存在差异。

The difference between the two is that the first will return a jQuery object, while the second returns a DataTables API instance.

关于javascript - 为什么服务器端 DataTable 上的 rows() 不是函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29146951/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com