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:
parent
fd0e0a42e4
commit
1f0b162760
6
media/js/jquery.dataTables.js
vendored
6
media/js/jquery.dataTables.js
vendored
@ -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, " " );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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, " " );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user