Dave
Dave

Reputation: 1502

$(...).DataTable(...).rows is not a function

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.com/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.

Upvotes: 2

Views: 13548

Answers (3)

Shantesh Sindgi
Shantesh Sindgi

Reputation: 375

This worked for me...

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

Upvotes: 0

Attila Szasz
Attila Szasz

Reputation: 3073

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()

Upvotes: 2

Itipacs
Itipacs

Reputation: 182

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.

Upvotes: 1

Related Questions