BUG: after upgrade to 1.7 filter does not return all matches

BUG: after upgrade to 1.7 filter does not return all matches

noelnoel Posts: 10Questions: 0Answers: 0
edited August 2010 in Bug reports
I found another issue where Datatables is behaving differently in IE vs Safari

I have a column whose value is either blank or metric.

When I use search term "metric" in Safari I correctly get back 38 matches
The same in IE returns 23 records. My initial guess is that search isn't going through all the pages.

Initialization is as follows:

[code]
oTable = $('#reports').dataTable({
"bJQueryUI": true,
"bProcessing": true,
"iDisplayLength": 75,
"bLengthChange": false,
"sPaginationType": "full_numbers",
"aoColumns": [
{ sWidth: '75px' },
{ sWidth: '75px' },
{ sWidth: '200px' },
{ sWidth: '300px' },
{ sWidth: '100px', sType: "num-html" },
{ sWidth: '150px' },
{ "bVisible": false },
//THIS IS THE COLUMN with metric, normally hidden { "bVisible": true },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false }]
});
[/code]

Replies

  • allanallan Posts: 63,602Questions: 1Answers: 10,486 Site admin
    Sounds very odd indeed! Can you post an example where this is happening please? If you don't want to make it public you can send it to me using http://datatables.net/contact .

    Allan
  • allanallan Posts: 63,602Questions: 1Answers: 10,486 Site admin
    On further investigation with help from noel, it would appear that the issue is that IE (and Opera) put a newline character after a
    tag when I read the content from a cell to decode HTML entities. This breaks the search unfortunately. The fix is to find this line:

    [code]
    oSettings.asDataSearch[i] = nTmp.textContent ? nTmp.textContent : nTmp.innerText;
    [/code]
    And add this just after it:

    [code]
    oSettings.asDataSearch[i] = oSettings.asDataSearch[i].replace(/\n/g," ").replace(/\r/g,"");
    [/code]
    I'll release a bug fix version of DataTables with this included it it in the near future. The bug will only be triggered in rows which have HTML entities and BR tags in them.

    Regards,
    Allan
This discussion has been closed.