When using jQuery DataTables is it possible to do accent-insensitive searches when using the filter? For instance, when I put the 'e' character, I'd like to search every word with 'e' or 'é', 'è'.
Something that came to mind is normalizing the strings and putting them into a separate, hidden column but that wouldn't solve the alphabetizing issue.
EDIT
I tried the following:
$.fn.dataTableExt.ofnSearch = function ( data ) {
return ! data ?
'' :
typeof data === 'string' ?
data
.replace( /
/g, ' ' )
.replace( /á/g, 'a' )
.replace( /é/g, 'e' )
.replace( /í/g, 'i' )
.replace( /ó/g, 'o' )
.replace( /ú/g, 'u' )
.replace( /ê/g, 'e' )
.replace( /?/g, 'i' )
.replace( /?/g, 'o' )
.replace( /è/g, 'e' )
.replace( /?/g, 'i' )
.replace( /ü/g, 'u' )
.replace( /?/g, 'c' ) :
data;
};
See Question&Answers more detail:os