I use the datatables plugin, and I would like to turn off the automatic filter in the table and instead place the search button when they are fully entered in their text and are ready to continue the search.
JSfiddle:
$(document).ready(function() { $('#example').dataTable(); } );
http://jsfiddle.net/84KNZ/
the button (href) is the "Go" filter
any idea?
thank
The first thing to do is to cancel the default keyup event from the search input:
$("div.dataTables_filter input").unbind();
Then we need to call data filtering from the moment of the link event:
$('#filter').click(function(e){ oTable.fnFilter($("div.dataTables_filter input").val()); });
http://jsfiddle.net/84KNZ/3/
, fnFilter , , , Enter , :
$("div.dataTables_filter input").unbind(); $("div.dataTables_filter input").on('keydown', function(e) { if (e.which == 13) { table.search( $("div.dataTables_filter input").val()).draw(); } });
Source: https://habr.com/ru/post/1544359/More articles:productbuild: add a third-party product archive to the installer? - xcodeAspnet MVC 4, проверяющий десятичные числа - jqueryjava.util.ConcurrentModificationException - ArrayList - javaFull-text column search of email addresses is interrupted when using wildcards - sqlПользовательский минимальный оператор для тяги:: кортеж в сокращении - c++Format Eclipse: add an empty line at the end of the class - javaHow to call an object's destructor when one of its methods is used as a callback for its own property? - ooprelative search path in powershell - powershell-v2.0Monitor various memory usage blocks in Spark and find out what ends in OOM? - scalaMATLAB - object destructor does not work when listeners participate - oopAll Articles