Im using Datatable for my current project. One of my tables has several columns. One of the columns is a column Statusthat will have one of three values Open, Rejectedand Approved. I want to filter the record shown in the table with three buttons, In Progressand Closedfor example:
<div class="btn-group pull-right">
<button id="onprogress" class="btn btn-default filter">On Process</button>
<button id="closed" class="btn btn-default filter">Closed</button>
<button id="all" class="btn btn-default filter">All</button>
</div>
Here is the javascript code I used:
var dataTables = $('#datatable').DataTable({
"info": false,
"lengthChange": false
});
$('#all').on('click', function () {
dataTables.columns(4).search("").draw();
});
$('#onprogress').on('click', function () {
dataTables.columns(4).search("Open" ).draw();
});
$('#closed').on('click', function () {
dataTables.columns(4).search("Rejected","Approved").draw();
});
The javascript code works well for the #onprogreess button because it only looks for one value Open. How to make it work with two-digit search?
(# closed button should show record with Rejectedor DoneStatus)