SearchPanes not working with plugins that remove accents

SearchPanes not working with plugins that remove accents

constellatorconstellator Posts: 5Questions: 2Answers: 0

When your code extends jQuery.fn.DataTable.ext.type.search (e.g., plugins like accent-neutralise or diacritics-neutralise), SearchPanes (at least when called from a button) will show the pane correctly, but after any selection, it will return no results. When you remove the extension, it works as expected.

This question has an accepted answers - jump to answer

Answers

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @constellator ,

    Thanks for your question. As noted in the forum rules, please post a link to a running test case showing the issue so we can offer some help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Thanks,
    Sandy

  • constellatorconstellator Posts: 5Questions: 2Answers: 0

    Hi, Sandy

    Here is the link:
    http://live.datatables.net/kesuwiji/1/edit

    To test: click the SearchPanes button. Select any record. Notice the message "No matching records found".

    Now comment the script containing the "ext.search", in this case:
    //cdn.datatables.net/plug-ins/1.10.21/filtering/type-based/accent-neutralise.js

    Now it filters as expected.

    Thanks for your attention.
    Ricardo

  • sandysandy Posts: 913Questions: 0Answers: 236
    Answer ✓

    Hi @constellator ,

    SearchPanes performs an exact match on the filter type. Take a look at this example. Here instead of the plug-in I am making use of a column renderer to remove the accents where appropriate while still allowing SearchPanes to do an exact match.

    We realise that this is not ideal and will look to improve the accent handling in the future.

    Thanks,
    Sandy

  • constellatorconstellator Posts: 5Questions: 2Answers: 0

    Hi, Sandy

    Thanks for your prompt and helpful answer!
    Now it is working as expected.
    Congrats once again for SearchPanes, it really makes DataTables stand out :)

    PS: I just commented this code out in my application, since it doesn't seem to be ever called (and removeAccents doesn't seem to exist) :
    else if(type === 'search') { return removeAccents(data); }

This discussion has been closed.