Datatables 2 with Natural plugin problem

Datatables 2 with Natural plugin problem

toniux79toniux79 Posts: 21Questions: 7Answers: 0

Link to test case:
https://live.datatables.net/woyozaci/4/edit

Debugger code (debug.datatables.net):
None

Error messages shown:
None

Description of problem:
It is said in release note of DataTable 2 that :
- Diacritic search support. You can now use DataTables search to look for accented characters without typing the accent.

This improvement does not work when the Natural sorting plugin is activated. I guess it is a bug ?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin
    Answer ✓

    Not really a bug as such (maybe?). More that the natural sorting plug-in doesn't provide a search formatter. Thankfully, it is easy to add:

    DataTable.type('natural', {
      search: function (d) {
        return DataTable.util.diacritics(d);
      }
    });
    

    https://live.datatables.net/woyozaci/6/edit

    Allan

  • toniux79toniux79 Posts: 21Questions: 7Answers: 0

    Thank you very much @allan !

  • toniux79toniux79 Posts: 21Questions: 7Answers: 0

    @allan , finally there is another problem with this solution :

    • If I type the text filter without accent 'Tigereze' it works and it gets the row with 'Tigerezé'.
    • But if type the text filter with the accent 'Tigerezé', it does not find anymore the row with 'Tigerezé'
  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin

    That's an error that I'm going to correct 2.0.1. This thread also raised that.

    Allan

Sign In or Register to comment.