[dataTables.js error] Uncaught TypeError: myTable.row is not a function

2023-05-25,,

使用dataTables.js时遇到的问题。

代码如下:

 var myTable = $('#dynamic-table')
.dataTable({
bAutoWidth : false,
"aoColumns" : [ {
"bSortable" : false
}, null, null, null ],
"aaSorting" : [],
}); $('#dynamic-table tbody').on( 'click', 'input', function () {
var data = myTable.row( this ).data();
});

解决办法一:

修改第2行的创建接口,修改后的代码如下:

 2       .DataTable({

解决办法二:

修改第11行的调用接口,修改后的代码如下:

11       var data = myTable.api().row( this ).data();

以上方法二选一即可。

[dataTables.js error] Uncaught TypeError: myTable.row is not a function的相关教程结束。

《[dataTables.js error] Uncaught TypeError: myTable.row is not a function.doc》

下载本文的Word格式文档,以方便收藏与打印。