2

I am using Datatables and I found that the searchbox is not appearing near the table.

$(document).ready(function() {
                    $('#dfUsageTable').DataTable({
                        pageLength: 10,
                        filter: true
                        deferRender:    true,
                        scrollY:        200,
                        scrollCollapse: true,
                        scroller:       true
                    });
                } );

I have tried adding filter option , but still it is not working.

JSFiddle

Asiya Fatima
  • 1,388
  • 1
  • 10
  • 20
Dinesh
  • 16,014
  • 23
  • 80
  • 122

4 Answers4

3

Please use the following code, you were missing ',' on the third line.

$('#dfUsageTable').DataTable({
    pageLength: 10,
    filter: true,
    deferRender: true,
    scrollY: 200,
    scrollCollapse: true,
    scroller: true
});
D.Rosado
  • 5,634
  • 3
  • 36
  • 56
Sumit Patel
  • 4,530
  • 1
  • 10
  • 28
2

I know it's a bit late, but I had a similar problem and none of the above helped. What did help was removing a link to a stylesheet I had added called 'hamburger.css' for a hamburger menu. When I removed that, all was fine. So, my suggestion is to remove or comment out css files, except for those required by DataTables, one by one.

John Wooten
  • 685
  • 1
  • 6
  • 21
2

I know it's too late, but hope it helps future visitors. add "searching": true, and put , after the filter: true

$(document).ready(function() {
  $('#dfUsageTable').DataTable({
    pageLength: 10,
    filter: true,
    deferRender: true,
    scrollY: 200,
    scrollCollapse: true,
    scroller: true,
    "searching": true,
  });
});
Ali Aref
  • 1,893
  • 12
  • 31
1

One more thing that could happen:

It can be the case that you have the 'dom' property defined without the 'f' option (which controls the appearing of the input search box, see).

Quick way of testing this is just commenting the 'dom' property in your DataTable, so you can discard that it's something in the way you define it which is messing things up. (Default value, with the searchbox, would apply then).

Manuel
  • 127
  • 2
  • 11