Quantcast
Channel: Free community support — DataTables forums
Viewing all articles
Browse latest Browse all 35273

Get DataTables element

$
0
0

I wrote my own little jQuery module that handles action buttons on a table. When I delete a row, I would like to test if the table is a datatable, and then remove the row through the DataTables api.

This returns true: $.fn.DataTable.isDataTable( $(that).closest('table.table-clickable')

But this doesn't work:

if ($.fn.DataTable.isDataTable( $(that).closest('table.table-clickable') )) {
  console.log('table seems to be a datatables');

  var myTable = $(that).closest('table.table-clickable').DataTable();
  myTable.row($(that).closest('tr')).remove.draw(false);
}

It gives me "TypeError: myTable.row(...).remove.draw is not a function"

What am I missing?


Viewing all articles
Browse latest Browse all 35273

Trending Articles