hi , i want to search in multi column in dataTables.
hi , i want to search in multi column in dataTables.
i've used below code to search in multi column.. when i call the filterColumn() function. data can not be fetched from database. what should i do ??
function filterColumn ( i ) {
$('#basicTable').DataTable().column.(i).search(
$('#col'+i+'_filter').val(),
).draw();
}
$('input.column_filter').on('keyup click', function () {
filterColumn($(this).attr('name'));
} );
<td align="center" id="0"><input class="column_filter" name="origin" placeholder="From" id="colorigin_filter" type="text"></td>
<td align="center" id="1"><input class="column_filter" name="destination" placeholder="To" id="coldestination_filter" type="text"></td>
Answers
DataTables' built-in search facility already provides multi-column filtering. See the most basic example: https://datatables.net/examples/basic_init/zero_configuration.html
hi tangerine,
i'm using datatable for this purpose. below bold portion cause something wrong occur.
function filterColumn ( i ) {
$('#basicTable').DataTable().column.(i).search(
$('#col'+i+'_filter').val(),
).draw();
}