1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-02-18 16:54:14 +01:00

Fix: IE8 bug where an empty string read from a DOM input element is JSON encoded as '"null"' - absolutely mental! See this blog post for more information http://blogs.msdn.com/b/jscript/archive/2009/06/23/serializing-the-value-of-empty-dom-elements-using-native-json-in-ie8.aspx .

This commit is contained in:
Allan Jardine 2012-04-13 11:56:01 +01:00
parent 773c88b9f6
commit 732d25b229
2 changed files with 10 additions and 6 deletions

View File

@ -1968,19 +1968,21 @@
jqFilter.bind( 'keyup.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 :-(
for ( var i=0, iLen=n.length ; i<iLen ; i++ )
{
if ( n[i] != $(this).parents('div.dataTables_filter')[0] )
{
$(n[i]._DT_Input).val( this.value );
$(n[i]._DT_Input).val( val );
}
}
/* Now do the filter */
if ( this.value != oPreviousSearch.sSearch )
if ( val != oPreviousSearch.sSearch )
{
_fnFilterComplete( oSettings, {
"sSearch": this.value,
"sSearch": val,
"bRegex": oPreviousSearch.bRegex,
"bSmart": oPreviousSearch.bSmart ,
"bCaseInsensitive": oPreviousSearch.bCaseInsensitive

View File

@ -33,19 +33,21 @@ function _fnFeatureHtmlFilter ( oSettings )
jqFilter.bind( 'keyup.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 :-(
for ( var i=0, iLen=n.length ; i<iLen ; i++ )
{
if ( n[i] != $(this).parents('div.dataTables_filter')[0] )
{
$(n[i]._DT_Input).val( this.value );
$(n[i]._DT_Input).val( val );
}
}
/* Now do the filter */
if ( this.value != oPreviousSearch.sSearch )
if ( val != oPreviousSearch.sSearch )
{
_fnFilterComplete( oSettings, {
"sSearch": this.value,
"sSearch": val,
"bRegex": oPreviousSearch.bRegex,
"bSmart": oPreviousSearch.bSmart ,
"bCaseInsensitive": oPreviousSearch.bCaseInsensitive