Searchpane doesn't return results if item contains an ampersand (&)
Searchpane doesn't return results if item contains an ampersand (&)
jmbishop
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 accepted answers - jump to:
Answers
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.
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
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
@colin can searchpanes be added to the nightly releases?
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
@allen can searchpanes be added to the nightly releases? (I dont mind a not finished product). Like this I get the latest.
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
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
Got it, thank you!
I'm using SearchBuilder 1.3.0 and I have the same issue. Any update there at all?
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
@sandy FYI I answered the same question in @woodsalexj other thread. Maybe it will help.
Kevin
Thanks @kthorngren . I'll reply there to keep it all in the same thread
Hi Community,
I am stuck with the SearchPane(s) and & (&) in values. I tried around with several versions of datatables.min.js and dataTables.searchPane.min.js, but I have no success with data containing and "&" (or HTML translated (&)).
I bypass the problem by stringreplace the "&" to an "and", but that's not the way it should work.
I tried around with the nightly build versions, but still no success.
Is there anything I missed, or is this still in development?
Thank you,
Chris
In this test case that @allan posted in Jan 2022 it is working:
http://live.datatables.net/nofaxizi/1/edit
In this test case from Sandy it works too:
http://live.datatables.net/dizacuqu/1/edit
Please also see this thread:
https://datatables.net/forums/discussion/71291/when-there-is-an-ampersand-in-one-of-the-rows-searchbuilder-doesnt-work#latest
Hi,
sorry for the circumstances.... I had loaded SearchPane(s) twice in my code. Once with SearchPane.js, the other with SearchPanes.js. There was a logic conflict.
Once I deleted the "old" Version, everything work like expected.
Thank you anyway!
Thanks for the update - good to hear it is working now.
Allan