_fnDataToSearch doesn't handle carriage returns correctly

_fnDataToSearch doesn't handle carriage returns correctly

jonathancampjonathancamp Posts: 1Questions: 0Answers: 0
edited August 2011 in Bug reports
If the data to be filtered contains a carriage return then the search won't succeed. The regular expression in _fnFilterCreateSearch could be modified to use 'multiline' or (in the patch below) you could modify _fnDataToSearch to replace the '\r'.

Example (search for 'foo'):
http://jsfiddle.net/kung_foo/Dd8FQ/

Patch:
http://pastebin.com/vg3huydj

- jonathan

P.S. Awesome plugin! :)

Replies

  • eyre.michaeleyre.michael Posts: 21Questions: 0Answers: 0
    I have just encountered the same issue.

    Thanks for the patch.

    Mike
  • allanallan Posts: 63,383Questions: 1Answers: 10,449 Site admin
    Sorry for the delay in looking at this one. Great patch, thanks for that Jonathan. I've just committed it into DataTables and its now part of the "nightly" on the downloads page, and will be included in the next release.

    Regards,
    Allan
This discussion has been closed.