When there is an & (ampersand) in one of the rows, Searchbuilder doesn't work.
When there is an & (ampersand) in one of the rows, Searchbuilder doesn't work.
woodsalexj
Posts: 21Questions: 6Answers: 0
I've seen that there is a fix for this in Searchpanes but it still doesn't work for searchbuilder 1.3. Any chance the fix can be applied?
I don't know how to create an example, but basically, create a column called "Name" and add a row where Name is "A&A Autobody", if you then do a search where Name = "A&A AutoBody", nothing is returned/shown in the table.
Answers
This technote documents various ways to create a test case. I created one for you:
http://live.datatables.net/fuqaquci/1/edit
If you have DOM sourced table data then the
&
is actually&
. You can use Orthogonal data to replace the&
with&
for thefilter
operation. This seems to work with the SearchBuilder.Kevin
Really appreciate your help, but unfortunately I can't define all the columns individually that I need to replace the & in. I'm using the same table definition across multiple pages with different columns in each page etc.
If I put A&A Autobody in the second column, the filter doesn't work then, see: http://live.datatables.net/fukasaje/1/edit
The
columnDefs.targets
docs show the different option you can use to define multiple targets. Keep in mind you can definecolumns.render
only once for each column. Updated test case:http://live.datatables.net/kavihupu/1/edit
Kevin
Hi @woodsalexj ,
I'm going to agree with @kthorngren here. You should be using
&
to represent & in your html code - if you use that then it also works. See this test case. Otherwise I think Kevin's solution is a good one.Thanks,
Sandy
@sandy FYI - Using
&
in the HTML doesn't work without using orthogonal data. The test case was still usingcolumns.render
to convert&
to&
. I commented outcolumns.render
in this example and SearchBuilder won't find the data with&
.http://live.datatables.net/jecekabo/1/edit
Kevin
Agreed I tried switching & for & before loading the data into the Datatable doesn't work
& for amp
Would be really nice if Searchbuilder was 'fixed' like searchpanes was, so it just works though
Ah ok I see. Will reopen and take another look!
Hi @woodsalexj @kthorngren ,
That should be the issue fixed now as you can see at this example. This will be available in the next SearchBuilder release which we hope will be in the next few weeks. Until then you can access the fix from the nightly builds.
Thanks,
Sandy