Searchpane doesn't return results if item contains an ampersand (&)

Searchpane doesn't return results if item contains an ampersand (&)

jmbishopjmbishop Posts: 4Questions: 2Answers: 0

In my Searchpane I have a list of categories. It displays all the categories available and indicates the number of items in that category. However, if one of the categories has an ampersand (Jams & Jellies), even though it indicates there are items in that category when you click on it to filter it clears the datatable and returns zero results.

Thanks for any assistance,
J Bishop

This question has an accepted answers - jump to answer

Answers

  • rf1234rf1234 Posts: 2,162Questions: 69Answers: 313
    edited November 2018

    Tried it with a normal search field. And had absolutely no issues. Without your code it will be difficult to figure this out.

    Changed the text to your "Jams & Jellies" and just entered an ampersand into the filter field. Worked.

  • colincolin Posts: 14,208Questions: 1Answers: 2,408

    Yep, as @rf1234 said, this needs a test case. 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.

    Cheers,

    Colin

  • colincolin Posts: 14,208Questions: 1Answers: 2,408
    Answer ✓

    Hi all,

    I was able to reproduce this (it was mentioned on github) - see here.

    This has now been fixed. It will be incorporated into the next DataTables release, but you can get it from here if you want it in the meantime,

    Cheers,

    Colin

  • yakov116yakov116 Posts: 16Questions: 1Answers: 0

    @colin can searchpanes be added to the nightly releases?

  • allanallan Posts: 55,883Questions: 1Answers: 8,835 Site admin

    That's the longer term plan. SearchPane is going to be promoted to be a fully supported extension (like Buttons, FixedHeader, etc), but there are a number of items we need to finish for it first - not least the documentation!

    Allan

  • yakov116yakov116 Posts: 16Questions: 1Answers: 0

    @allen can searchpanes be added to the nightly releases? (I dont mind a not finished product). Like this I get the latest.

  • ezezezezezez Posts: 4Questions: 1Answers: 0

    While this thread goes back about 1.5 years, I believe I am seeing a similar issue now. If I have a searchPane filter that has an entry that includes and ampersand "&" the datatable will not show any results.

    JSZip 2.5.0, DataTables 1.10.22, Buttons 1.6.4, Column visibility 1.6.4, HTML5 export 1.6.4, Print view 1.6.4, ColReorder 1.5.2, FixedHeader 3.1.7, Responsive 2.2.6, SearchPanes 1.2.0, Select 1.3.1

    I have recorded a brief video showing the issue:
    https://youtu.be/n0SBWcv9LfE

    If it helps, this is link to the page that will load the datatable with a searchPane filter that has the ampersand:
    https://gdanalyst.herokuapp.com/pbp?gameid=8114397

  • colincolin Posts: 14,208Questions: 1Answers: 2,408

    This thread is for SearchPanes v1, we're on v2 now!

    That said, it's not working on the released version of v2, which you're using, but it is on the nightly version - see here: http://live.datatables.net/fapuzusa/6/edit

    We're aiming on releasing 1.2.2 (which will contain the fix) in the next week or two, but in the meantime the nightly build would get you going.

    Apologies for the inconvenience,

    Colin

  • ezezezezezez Posts: 4Questions: 1Answers: 0

    Got it, thank you!

  • woodsalexjwoodsalexj Posts: 11Questions: 3Answers: 0

    I'm using SearchBuilder 1.3.0 and I have the same issue. Any update there at all?

  • sandysandy Posts: 913Questions: 0Answers: 234

    Hi @woodsalexj ,

    Thanks for pointing this out. Something isn't right there. I've raised an issue internally (DD- for my reference) and will report back here when there is an update. I also created a test case to show this which you can find here.

    Thanks,
    Sandy

  • kthorngrenkthorngren Posts: 15,822Questions: 25Answers: 3,751

    @sandy FYI I answered the same question in @woodsalexj other thread. Maybe it will help.

    Kevin

  • sandysandy Posts: 913Questions: 0Answers: 234

    Thanks @kthorngren . I'll reply there to keep it all in the same thread :)

Sign In or Register to comment.