Can't attach jQuery to DataTable
Can't attach jQuery to DataTable
I am using this example as my table: https://datatables.net/examples/api/row_details.html
Instead of .hide() and .show() I want to try and make it a little more appealing with using slideUp() and slideDown()
so I changed line 50 from:
row.child( format(row.data()) ).show();
to:
row.child( format(row.data()) ).slideDown();
But this results in a jQuery error:
Uncaught TypeError: row.child(...).slideDown is not a function
I don't understand because .show() is a jQuery function, just like slideDown() so why is it not working?
This question has an accepted answers - jump to answer
Answers
row().child()
returns a Datatable API instance. Chaining a jQuery method won't work. Alsoow().child().show()
is a Datatable API not a jQuery method.Take a look at this thread for a technique to use
slideDown()
.Kevin