1
0
mirror of https://github.com/DataTables/DataTables.git synced 2024-12-01 13:24:10 +01:00

Fix example: multi filter needs a way to be cleared

This commit is contained in:
Allan Jardine 2014-06-27 15:24:07 +01:00
parent 777907d7f3
commit 485b44965e
2 changed files with 7 additions and 3 deletions

View File

@ -1 +1 @@
6d8d6174baab103432f86fb04c721d15b65ed757
35a4dd00a0ea1481ccd404c47ae82b45268f22aa

View File

@ -26,8 +26,10 @@ $(document).ready(function() {
var select = $('<select><option value=""></option></select>')
.appendTo( $(this).empty() )
.on( 'change', function () {
var val = $(this).val();
table.column( i )
.search( '^'+$(this).val()+'$', true, false )
.search( val ? '^'+$(this).val()+'$' : val, true, false )
.draw();
} );
@ -575,8 +577,10 @@ $(document).ready(function() {
var select = $('&lt;select&gt;&lt;option value=&quot;&quot;&gt;&lt;/option&gt;&lt;/select&gt;')
.appendTo( $(this).empty() )
.on( 'change', function () {
var val = $(this).val();
table.column( i )
.search( '^'+$(this).val()+'$', true, false )
.search( val ? '^'+$(this).val()+'$' : val, true, false )
.draw();
} );