Accent neutralise search area
Accent neutralise search area
Hello,
I need to neutralise accent in search area. For example in French : éd... -> édition or ed... -> édition.
The solution in the discussion https://datatables.net/forums/discussion/42829/accent-neutralise-search-localecompare-sorting?
works very well. You can see it https://jsfiddle.net/d9vtu79g/
But i have a stupid problem. I searched but i can integrate it with my script.
In the solution, table is initialized by var table = $('#example').DataTable({ columnDefs : [{ targets: 0, type: 'locale-compare' },]})
.
In my script, table is initialized by $('#example').DataTable({ "order": [[ 0, "desc" ]], "columnDefs": [{"targets": [ 0 ],"visible": true,"searchable": true,...
with $.extend( $.fn.dataTable.defaults, {autoWidth: false, columnDefs: [{ orderable: false, width: '100px', targets: [ 5 ]...
Is it possible to use locale-compare
in my case and how ?
Or do I have to change the shape of all my scripts ?
Thank you very much for your help.
Chris
This question has an accepted answers - jump to answer
Answers
Add
{ targets: 0, type: 'locale-compare' }
into yourcolumnDefs
array (assuming you want it only on column index 0).Allan
Hello Allan,
At first I thought it was a syntax problem.
With your answer, i found the problem came from the function
$.fn.dataTable.defaults
in my script.Thank you very much.
Chris
Hey @Chris_fr7 , could you mark Allans comment above as the answer, your post is sitting in the
unanswered questions
page at the momentI've updated it. @Chris_fr7 - good to hear you've got it working now.
Allan