Reputation: 57
I have a table with several columns loaded from the DB, I applied a filter to be able to load only the wo's closed, but when I apply to look for the wo's open nothing appears.
Maybe I have to do a reload in the datatable?
$("#close").click(function(){
var table = $('#todolist').DataTable();
table.columns([2,3]).search("W.O.", "Close").draw();
});
$("#open").click(function(){
var table = $('#todolist').DataTable();
table.columns([2,3]).search("W.O.", "open").draw();
});
I tried to use $('#pedidos').DataTable().ajax.reload();
but it didn't work.
Upvotes: 0
Views: 3104
Reputation: 482
$("#open").click(function(){
$("#todolist").DataTable().draw();
});
Use this function wherever you want to refresh the datatable.
Upvotes: 1