Tavmant / jquery-datatables-column-filter

Automatically exported from code.google.com/p/jquery-datatables-column-filter
0 stars 0 forks source link

Two instances using column filters interfere with each other #36

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a page with two datatables, with different column names (e.g ["A1", 
"A2"] and ["B1", "B2"], and both using column-filter. 
2. First initialize A-table, then B-table
2. Enter something into a col-filter in A-table col A1, and delete it again

What is the expected output? What do you see instead?
Expected is that the text "A1" reappears in the filter input box, but instead I 
see "B1". 

What version of the product are you using? On what operating system?
Chrome/ubuntu

Please provide any additional information below.
I think this is due to the initialization doen in 
jquery.dataTables.columnFilter.js:

    $.fn.columnFilter = function (options) {

        var asInitVals, i, label, th;

Since this function is only created when the script is loaded, effectively this 
makes the variable "asInitVals" a global resource which is shared by both 
datatables, making the latter initialization of B-table overwrite the initvals 
for the A-table. 

Original issue reported on code.google.com by martin.holst on 14 Oct 2011 at 11:15

GoogleCodeExporter commented 8 years ago
Sorry, turned out I was using 0.9.0, it is fixed in 1.3.2. Please disregard 
this. 

Original comment by martin.holst on 16 Oct 2011 at 10:11

GoogleCodeExporter commented 8 years ago

Original comment by joc...@gmail.com on 22 Oct 2011 at 3:37