Possible bug in fnFilter

Possible bug in fnFilter

daniel_rdaniel_r Posts: 460Questions: 4Answers: 67
edited August 2013 in Bug reports
Hi,

Before I start: here is the live example (using latest stable version of datatables): http://yadcf-showcase.appspot.com/multiple_tables.html

For start I got 3 tables in page one is: [code]$('#example1').dataTable(....[/code] and two others [code]$('.second_third').dataTable(....[/code]

all got 5 columns, I have noticed that when I filter the third table first column and than try to filter the second table by fifth column datatables thinks that it should apply the first column filter of the third table to the second table too...

I did a little debug in the http://datatables.net/download/build/jquery.dataTables.js and noticed the following behavior:

when doing the first column filter in the third table the extend code (line5642):

[code]/* Single column filter */
$.extend( oSettings.aoPreSearchCols[ iColumn ], {
"sSearch": sInput+"",
"bRegex": bRegex,
"bSmart": bSmart,
"bCaseInsensitive": bCaseInsensitive
} );[/code]

the code above puts the extended value into both DataTable.settings[1].aoPreSearchCols and DataTable.settings[2].aoPreSearchCols,

So if I filter in the third table for "Some Data a" value, this value will be placed into sSearch of settings of table 1 and 2, and thats why when I will try to filter in the second table (where there is no "Some Data a" value in the first column) it will show no results

Here a live example, Scenario is as follows:

1) Filter in third table : first column for "Some Data a" value

2) Filter in second table : fifth column for "Tag1" value

p.s if I remove the first table the bug still occurs... so its not because of the fist table

Here is the live example again (using latest stable version of datatables): http://yadcf-showcase.appspot.com/multiple_tables.html

Regards,

Daniel.
This discussion has been closed.