Bug with searching multiline columns + fix

Bug with searching multiline columns + fix

motmot Posts: 5Questions: 0Answers: 0
edited April 2010 in Bug reports
DataTables can not search in multiline (containing '\n') columns. Fix is provided.
Replace
[code]var rpSearch = new RegExp( sRegExpString, "i" );[/code]
with
[code]var rpSearch = new RegExp( sRegExpString, "im" );[/code]

Replies

  • CassiannoCassianno Posts: 19Questions: 0Answers: 0
    A column multilined isnt breaked within BR's?

    Anyway, thanks for you contribution... Some1 may be need this (or even me later ^^)
  • allanallan Posts: 57,300Questions: 1Answers: 9,127 Site admin
    Actually DataTables should be stripping new lines from the input for exactly this reason. This line "return sData.replace(/\n/g," ");" in _fnDataToSearch() is what does that. Perhaps you could provide an example of this not working please? The zero config example ( http://datatables.net/examples/basic_init/zero_config.html ) has a newline in "Internet Explorer 4.0" to test exactly this.

    Allan
This discussion has been closed.