I'm trying to set up an extremely basic DataTables example. After initializing the table with DataTables, why are some of the API methods not available? Am I missing something as far as how it's supposed to be used?
Here's a simple jsfiddle where I initialize the table, and then try to retrieve the first row. However, it doesn't look the like row()
method exists:
http://jsfiddle.net/LEWQU/
Here's the javascript in the fiddle:
$(document).ready(function(){
var myDataTable = $('#myTable').dataTable();
console.log(myDataTable.row(0));
});
Developer console shows the following error referring to the console.log
line:
Uncaught TypeError: undefined is not a function
Any help here is much appreciated.
change
var myDataTable = $('#myTable').dataTable();
to
var myDataTable = $('#myTable').DataTable();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With