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

Fix: Add support for the input, paste and cut events in the filter input

- IE10 has a little `x` to clear text boxes which fires the `input`
  event, so we need to monitor for that in the filtering input.

- While I'm here, I've also added support for the paste and cut events
  to change the filtering when they fire. Via keyboard the fire on
  keyup, but not if you use the mouse. They do now.

- Not that it us possible to have multiple events fire (keyup + paste
  for example). The logic of checking for a change of input counters
  this.

- Thhis fixes DataTables/DataTables issue #227.
This commit is contained in:
Allan Jardine 2013-09-23 11:45:06 +01:00
parent 4e5cad9640
commit 5a3401ee5b
2 changed files with 2 additions and 2 deletions

View File

@ -1 +1 @@
4b57552330bd9f16097a4cb8d529d9d56d8aa5e9
2fc7d68b67ae47fd952c4409f1c1a6227e2bb648

View File

@ -2197,7 +2197,7 @@
nFilter._DT_Input = jqFilter[0];
jqFilter.val( oPreviousSearch.sSearch.replace('"','"') );
jqFilter.bind( 'keyup.DT search.DT', function(e) {
jqFilter.bind( 'keyup.DT search.DT input.DT paste.DT cut.DT', function(e) {
/* Update all other filter input elements for the new display */
var n = oSettings.aanFeatures.f;
var val = this.value==="" ? "" : this.value; // mental IE8 fix :-(