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

Dev fix: In the update to the search array building methods I neglegted to strip \n\r from all rows (only HMTL rows were being stripped) - this is required for searching to work as expected. Picked up by the unit tests.

This commit is contained in:
Allan Jardine 2012-08-08 22:05:14 +01:00
parent fd0e0a42e4
commit 1f0b162760
3 changed files with 8 additions and 9 deletions

View File

@ -2352,12 +2352,10 @@
if ( sSearch.indexOf('&') !== -1 )
{
sSearch = $('<div>').html(sSearch).text();
/* IE and Opera appear to put an newline where there is a <br> tag - remove it */
sSearch = sSearch.replace( /[\n\r]/g, " " );
}
return sSearch;
// Strip newline characters
return sSearch.replace( /[\n\r]/g, " " );
}
/**

View File

@ -319,12 +319,10 @@ function _fnBuildSearchRow( oSettings, aData )
if ( sSearch.indexOf('&') !== -1 )
{
sSearch = $('<div>').html(sSearch).text();
/* IE and Opera appear to put an newline where there is a <br> tag - remove it */
sSearch = sSearch.replace( /[\n\r]/g, " " );
}
return sSearch;
// Strip newline characters
return sSearch.replace( /[\n\r]/g, " " );
}
/**

View File

@ -18,6 +18,7 @@ $(document).ready( function () {
],
"aoColumns": [
{ "mDataProp": "a" },
{ "mDataProp": "b" },
{ "mDataProp": "b.c" }
]
} );
@ -42,6 +43,7 @@ $(document).ready( function () {
],
"aoColumns": [
{ "mDataProp": "a" },
{ "mDataProp": "b" },
{ "mDataProp": "b.c", "sDefaultContent": "allan" }
]
} );
@ -62,11 +64,12 @@ $(document).ready( function () {
],
"aoColumns": [
{ "mDataProp": "a" },
{ "mDataProp": "b" },
{ "mDataProp": "b.c", "sDefaultContent": "allan" }
]
} );
},
function () { return $('#example tbody td:eq(5)').html() === "allan"; }
function () { return $('#example tbody td:eq(8)').html() === "allan"; }
);
oTest.fnComplete();