I currently have custom filter buttons that use the search API function of the database.
HTML
<ul>
<li class="btn"><a href="#" data-type="all">All</a></li>
<li class="btn"><a href="#" data-type="video">Video</a></li>
<li class="btn"><a href="#" data-type="image">Image</a></li>
<li class="btn"><a href="#" data-type="upload">Upload Dash</a></li>
<li class="btn"><a href="#" data-type="link">Code Link</a></li>
</ul>
JQuery
var table = $('#rlist').dataTable( {
"processing": true,
"serverSide": true,
"order": [[ 0, "asc" ]],
"sDom": "<'row'<'col-sm-6'l><'col-sm-6'T <'clearfix'>f>r>t<'row'<'col-sm-5'i><'col-sm-7'p>>",
"sPaginationType": "full_numbers",
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
"ajax": baseurl+"media/ajax_fetch"
});
$('ul').on('click', 'a', function() {
table
.columns(1)
.search($(this).text())
.draw();
});
$('ul').on('click', 'a.all', function() {
table
.search('')
.columns(1)
.search('')
.draw();
});
The problem is I don't want to use the search API, I want to send the button data-type attribute to the server side where I can manipulate manually not interfering with the search function.
How do I do this?