Steve Steve - 1 year ago 115
jQuery Question

Jquery Datatable search

I've created a datatable using Jquery Datatable.

"pagingType": "simple_numbers",
"bLengthChange": false,
"iDisplayLength": 10,
"aaSorting": [[0, 'asc']],
"processing": true,
"serverSide": true,
"ajax": $('#mytable').data('source'),
"aoColumnDefs": [
{'bSortable': false, 'aTargets': [3, 4]}


But How can I search on the data displayed on the table?

Answer Source
var dataTable = $('#mytable').dataTable();

  $('#yourInputFieldID').on('input keyup paste', function () {

// To prevent submit on enter we need to prevent default behaviour of Enter key on keydown event

$('#yourInputFieldID').keydown(function (event) {
    if (event.keyCode === 13) {
      return false;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download