Ajax filtering not working
Ajax filtering not working
apu889
Posts: 3Questions: 2Answers: 0
hi, just signed up because my mind confused all day figuring out why this code doesn't want to filter the datas. Any entry entered inside the filter won't affecting any changes on the table. but if the data are not loaded using ajax (inserting manuals using tr-td) the filters are working precisely.
the code:
table = $('#table').DataTable({
"processing": true, //Feature control the processing indicator.
"serverSide": true, //Feature control DataTables' server-side processing mode.
"order": [], //Initial no order.
// Load data for the table's content from an Ajax source
"ajax": {
"url": "<?php echo site_url('person/ajax_list')?>",
"type": "POST"
},
initComplete: function () {
this.api().columns().every(function () {
var column = this;
var input = document.createElement("input");
$(input).appendTo($(column.footer()).empty())
.on('change', function () {
column.search($(this).val(), false, false, true).draw();
});
});
},
});
whole code: https://paste.ee/p/7Nxbf#
sorry my bad english.
any help would be appreciated, thanks.
This discussion has been closed.