Sort without accents
Sort without accents
ivanlopes
Posts: 4Questions: 0Answers: 0
Hello There,
Im having problem sorting word that have accent. i found a post here that a guy named rbraga found a solution.
The solution was that the code snippet that he wrote remove all accent before sorting. but i can't understand how to use the code, in fact i thing the code is incomplete:
at jquery.dataTables.js
[code]
function removeAccents(strAccents){
strAccents = strAccents.split('');
strAccentsOut = new Array();
strAccentsLen = strAccents.length;
var accents = '
I would really love if someone could help me on this, please.
Ivan Lopes
Im having problem sorting word that have accent. i found a post here that a guy named rbraga found a solution.
The solution was that the code snippet that he wrote remove all accent before sorting. but i can't understand how to use the code, in fact i thing the code is incomplete:
at jquery.dataTables.js
[code]
function removeAccents(strAccents){
strAccents = strAccents.split('');
strAccentsOut = new Array();
strAccentsLen = strAccents.length;
var accents = '
I would really love if someone could help me on this, please.
Ivan Lopes
This discussion has been closed.
Replies
Allan
"Uncaught TypeError: Cannot read property 'search' of undefined "
then i did some research on the internet and i found a guy that says to replace
jQuery.fn.DataTable.ext.type.search.string to this $.fn.dataTableExt.ofnSearch['string']
and the error was gone. But when i used the .keyup function () from my input i got the same error:
"Uncaught TypeError: Cannot read property 'search' of undefined ".
So i went to the "table.search" and replace it with : table.ofnSearch['string'].
The error was gone but its not working. its sorting but dont remove the accent.
Im sorry.
Allan
Uncaught TypeError: Object [object Object] has no method 'search' .
Its sorting and filtering but not with accents.
:(
Allan
Click on "Nova Utilização" and wait a little to load the table.
One thing i think you should know. Im loading the table inside a div using jquery .load().
Thank you very much
Hi,
I made a mistake in my original reply - sorry about that. I posted you to a filtering plug-in that would neutralise accents for filtering - not for sorting...
For accent sorting, take a look at this plug-in: http://datatables.net/plug-ins/sorting/chinese-string . I've found that in old version of IE the sorting is a bit odd, due to an error in old IE, but it should work in newer browsers.
See this example for how to use the plug-in.
Allan