Why does my search does not work ?
Why does my search does not work ?
hcha
Posts: 3Questions: 2Answers: 0
Hi,
My datatable is filled by a JSon source returned by an Ajax request (server side processing).
I add a input type text to search among values of a column but it does not work...
Here is how my datatable is initialised in my .jsp page
$('#table_events').DataTable({
serverSide: true,
processing: true,
ordering: false,
paging: true,
scrollY: '75vh', // vh unit is a percentage of the browser window height
deferRender: true,
scrollCollapse: true,
searching: true,
//stateSave: true, // Keeps scroller position in case of page reloading
ajax: {
url: "/elogs/proposalEvents/reloadData",
type: "GET"
},
scroller: {
loadingIndicator: true,
serverWait: 250,
displayBuffer: 25,
boundaryScale: 0.75
},
language: {
loadingRecords: "Please wait : loading data...",
processing: "Please wait : loading data..."
},
"aoColumns": [{"sType":"string"}],
"aoColumnDefs": [
{"bVisible": false, "aTargets": [3], "searchable": true},
{"bVisible": false, "aTargets": [4], "searchable": false}
]
});
My input type text is :
<input type="text" id="search-input-text">
And the code to trigger the search is :
var table = $('#table_events').DataTable();
$('#search-input-text').on('keyup', function () {
var family =$(this).val(); // getting search input value
table.columns(3).search(this.value).draw();
});
Thanks in advance for your help !
This discussion has been closed.