最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - $(...).DataTable(...).rows is not a function - Stack Overflow

programmeradmin3浏览0评论

I added to my project the jquery.dataTables.min.js (1.10.3 version) (called js1 for convenience) to use DataTable().rows().nodes() function (and others) and its works fine.

Now, I'm trying to implement a nested table with Datatable plugin, here the jsfiddle (in the same page of my project).

As you can see in the fiddle is used:

.dataTables/1.9.0/jquery.dataTables.min.js (called js2 for convenience)

that is different from js1.

This two different plugin serve both. Because without js1 I get this error:

Using $(...).DataTable(...).rows is not a function or $(...).dataTable(...).rows is not a function I always get the same error.

Without js2 nested table in the jsfiddle does not work.

So, I added both two plugins to my page. But I get the error (.row is not ...) yet.

See the new jsfiddle with the error.

I added to my project the jquery.dataTables.min.js (1.10.3 version) (called js1 for convenience) to use DataTable().rows().nodes() function (and others) and its works fine.

Now, I'm trying to implement a nested table with Datatable plugin, here the jsfiddle (in the same page of my project).

As you can see in the fiddle is used:

http://ajax.aspnetcdn./ajax/jquery.dataTables/1.9.0/jquery.dataTables.min.js (called js2 for convenience)

that is different from js1.

This two different plugin serve both. Because without js1 I get this error:

Using $(...).DataTable(...).rows is not a function or $(...).dataTable(...).rows is not a function I always get the same error.

Without js2 nested table in the jsfiddle does not work.

So, I added both two plugins to my page. But I get the error (.row is not ...) yet.

See the new jsfiddle with the error.

Share Improve this question asked Jan 5, 2016 at 11:11 DaveDave 1,5125 gold badges31 silver badges49 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 2

the .DataTable() contructor returns the new api introduced in 1.10.

To have the old functionality, use the .dataTable() constructor.

If you need both the new api functionality and the old one, you can use the .dataTable() constructor to create your table object and use the new api like this: myTable.api().whateverFunction()

I get the same error with the same version.

I "fix" it doing the following steps

Step 1

Open console in your web

Step 2

Create a variable of your dataTable

Ex:

    var p = $('#my_table').dataTable();

Step 3

Now you write "p" and a dot and you have all of the aviable functions. I dont know why but I have differents names of the functions. I just search what I need.

Hope may help.

This worked for me...

var table = $('#myDataTableuser2349').dataTable()
var data = table.fnGetData()
console.log("data",data);
发布评论

评论列表(0)

  1. 暂无评论