Search with &

Search with &

eeighteeight Posts: 7Questions: 3Answers: 0

Hi all, I am having trouble searching my table. Some rows have & in the data (ie: TEST-R&D | Timesheet | Work). When using the search field it doesn't match when inputting TEST-R&D, but match when inputting TEST-R&

I am using both method to search / filter:

var val = $.fn.dataTable.util.escapeRegex($(this).val());
column.search( val ? '^'+val+'$' : '', true, false ).draw();

and

table.search(this.value).draw();

Any ideas?

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,167Questions: 26Answers: 4,921
    Answer ✓

    Seems to work here:
    http://live.datatables.net/yaparime/1/edit

    Please update the test case or provide a link to your page so we can see exactly what you have and what you are doing.

    Kevin

  • eeighteeight Posts: 7Questions: 3Answers: 0

    Thank you! A good night of sleep will help and if it's still not working will drill down my implementation and come back here.

  • eeighteeight Posts: 7Questions: 3Answers: 0

    @kthorngren Thanks for your time on this one. It works, the ajax json is converting & to &

  • eeighteeight Posts: 7Questions: 3Answers: 0

    & to &

This discussion has been closed.