I\'m using DataTables (datatables.net) and I would like my search box to be outside of the table (for example in my header div).
Is this possible ?
More recent versions have a different syntax:
var table = $('#example').DataTable();
// #myInput is a element
$('#myInput').on('keyup change', function () {
table.search(this.value).draw();
});
Note that this example uses the variable table assigned when datatables is first initialised. If you don't have this variable available, simply use:
var table = $('#example').dataTable().api();
// #myInput is a element
$('#myInput').on('keyup change', function () {
table.search(this.value).draw();
});
Since: DataTables 1.10
– Source: https://datatables.net/reference/api/search()