Can't attach jQuery to DataTable

Can't attach jQuery to DataTable

sjw01sjw01 Posts: 67Questions: 36Answers: 1

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

  • kthorngrenkthorngren Posts: 21,172Questions: 26Answers: 4,923
    edited August 2020 Answer ✓

    I don't understand because .show() is a jQuery function, just like slideDown() so why is it not working?

    row().child() returns a Datatable API instance. Chaining a jQuery method won't work. Also ow().child().show() is a Datatable API not a jQuery method.

    Take a look at this thread for a technique to use slideDown().

    Kevin

This discussion has been closed.