BUG: after upgrade to 1.7 filter does not return all matches
BUG: after upgrade to 1.7 filter does not return all matches
noel
Posts: 10Questions: 0Answers: 0
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]
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]
This discussion has been closed.
Replies
Allan
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