Dropdown searching is not happing for individual columns
Dropdown searching is not happing for individual columns

HI ,
I am using this reference for individual columns search:
https://datatables.net/examples/api/multi_filter_select.html
In that case they are using table data manually (hardcoded) but in my case data coming from server.php
using ajax .
My data like this;
$('#example').DataTable( {
"processing": true,
"serverSide": true,
"ajax": "server.php?min="+min+"&max="+max,
initComplete: function () {
this.api().columns().every( function () {
var column = this;
var select = $('<select><option value=""></option></select>')
.appendTo( $(column.footer()).empty() )
.on( 'change', function () {
var val = $.fn.dataTable.util.escapeRegex(
$(this).val()
);
column
.search( val ? '^'+val+'$' : '', true, false )
.draw();
} );
column.data().unique().sort().each( function ( d, j ) {
select.append( '<option value="'+d+'">'+d+'</option>' )
} );
} );
}
} );
} );
HTML code:
<table id="example" class="display" style="width:100%">
<thead>
<tr>
<th>Test1</th>
<th>Test2</th>
<th>Test3</th>
<th>Tes4</th>
</thead>
<tfoot>
<tr>
<th>Test1</th>
<th>Test2</th>
<th>Test3</th>
<th>Test4</th>
</tr>
</tfoot>
</tbody>
</table>
My problem is when i select dropdown i am not getting search result ,i am getting like No matching records found
dropdown values coming properly ,but searching is not happing.
Could you please help me any one .i was setting from 2 days on this .
Thanks
Sandee
Answers
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
hi @colin ,thanks for your valuable response ,i can give the test case but problem is my data comimg from database in server.php file ;
in server.php file my code like this ;
i have given my html and js code in above ,kinldy check once all are workinf fine only but search is not happing ,when i select paerticluar column value by the dropdown it not happing .
kindly give me solution.
Thanks
Sandeep
There are a few threads on this, such as this one here, it would be worth following those.
Colin