• 1000 функция
function search_nm(){
var table = initTable();
var sc_nm = $('#sc_nm').val();
var colm = ["A_", "B_", "C_", "D_", "E_", "F_", "G_"];
var filters = [];
table.column(0).data().each( function ( value, index ) {
var inr_id = index+1;
colm.forEach(function(entry) {
var all_item = $('#'+entry+inr_id).val();
all_item = all_item.toLowerCase();
if (all_item.includes(sc_nm)) { // find the match and get id
if (filters.includes(inr_id) === false) filters.push(inr_id);
}
});
});
// filters output will [1,2]
table.rows( filters ).draw(); // doesn't work
}
function initTable() {
return $('#tabel_detil').DataTable({
"sPaginationType": "full_numbers",
"responsive": true,
"retrieve": true,
"bFilter": false,
"stateSave": true,
"bSort": false,
"paging": false,
"processing": true,
"searching": false,
"sAjaxSource": "<?php echo base_url().'/getDataDetil/'; ?>",
"initComplete": function(settings, json) {
var elements = $("#tabel_detil_wrapper .row .col-xs-12");
var reqE = elements[1];
reqE.innerHTML = "<div class='col-md-2 col-md-offset-2'> </div><div class='col-md-8' style='margin-top: 17px; float: right;'><div class='col-md-offset-2 col-md-2' style='margin-top: 4px;'>Search : </div><div class='col-md-8'><input type='text' id='sc_nm' name='sc_nm' class='form-control input-sm' style='width:100%' onkeyup='search_nm()'></div></div>";
}
});
}
что я хочу как , и как мне это исправить?