Order DataTable with accents
Order DataTable with accents
Gea
Posts: 33Questions: 13Answers: 1
Hi! So, i have a json that have names with accents, but when i start my app, the names with accents are in the end.
Example:
" if i have Angela, Ángela, Maria, Robert, it's seems like that:
Angela
Maria
Robert
Ángela
"
I want that the names with accents don't appear on the end, but like that:
"
Angela
Ángela
Maria
Robert
"
Anny idea? Thanks !!!!
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Try this plug-in. Despite the name it will work for a number of languages since it uses
localeCompare
. The reason that isn't the default in DataTables is that its slower than a string compare (significantly slower) and there were bugs in its implementation in old versions of IE.There is a new i18n API in the Javascript standard which I'll be writing a plug-in for and blogging about soon. The WebKit folks are working on implementing it just now and I thin they are the last browser engine to implement it.
Regards,
Allan
It's works for me!
Thanks!
Hello Allan, i got problems with the plug-in.
When i tried to order columns with null value, the localeCompare displayed me an error.
I changed the plug-in and now it works perfectly.
Here is the code:
Regards.
Gea.