How to disable incremental filter

How to disable incremental filter

dcadlerdcadler Posts: 2Questions: 1Answers: 0

I am using Datatables.Net v1.10 and I am using an external data source via an API and ajax within the datatable. I would think that in a serverside scenario, incremental search would be disabled by default. However, I really need to disable it and have the filter be performed after the user hits enter or add a Go button to the filter box, as my data sets tend to be very large. How can I achieve this?

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,309Questions: 26Answers: 4,947
    Answer ✓

    Here are a couple options.

    1. Remove the default Global Search input using the dom option and add your own input.
    2. Turn off the Datatables created event and create your own for the input. This example should give you some ideas:
      http://live.datatables.net/jorexujo/5/edit

    Kevin

  • allanallan Posts: 63,471Questions: 1Answers: 10,467 Site admin

    Just to add to point 1, you would call search() with your own input element when you are ready to do the search (perhaps on press of a button or return key).

    Allan

  • dcadlerdcadler Posts: 2Questions: 1Answers: 0

    @kthorngren that was exactly what I was looking for. Thanks. Also, how are you displaying the X in the search box when you start to type and allow that to clear the field when clicked upon? It is not in the CSS in the live.datables link.

This discussion has been closed.