Multiple DTs on Page, Can't be Searched By Columns
Multiple DTs on Page, Can't be Searched By Columns
tpurcher
Posts: 2Questions: 2Answers: 0
We have several DTs that are created on the same page like this:
var tables = $('.table-data').DataTable({ // create multiple DTs
"bPaginate": false,
"columnDefs": [
{ 'orderable': false, 'targets': [2, 3, 4, 5, 6, 7, 8, 9, 10, 11] }
],
"info": false,
"order": [[0, "asc"], [1, "asc"]]
});
Simple enough.
We also have a search function that we want to use across all the table, but only in the first two columns of each table. We build up a simple RegEx that we use in the search() function, searching the 3rd column, and it works fine except that it only searches the first table! Here's the relevant piece of the search() function:
tables.column(2).search(regExSearch, true, false, false).draw();
How can we search column 3 in all the DTs that were created?
Thanks
This discussion has been closed.