Tavmant / jquery-datatables-column-filter

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

bVisible causes wrong columns to be used #37

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If you change the example Javascript in "index.html" in the download package to:

$(document).ready(function(){
     $('#example').dataTable({aoColumnDefs:[{"bVisible": false, aTargets: [0]}]})
          .columnFilter({
            aoColumns: [ { type: "select", values: [ 'Gecko', 'Trident', 'KHTML', 'Misc', 'Presto', 'Webkit', 'Tasman']  },
                     { type: "text" },
                     null,
                     { type: "number" },
                     { type: "select", values: [ 'A', 'C', 'U', 'X']  }
                ]

        });
});

Then the bVisible option causes problems for the filtering. The second column 
is given the select options rather than the first (hidden) column.

DataTables has two internal functions which might be handy here: 
_fnVisibleToColumnIndex and _fnColumnIndexToVisible.

Original issue reported on code.google.com by allan.ja...@gmail.com on 15 Oct 2011 at 12:12

GoogleCodeExporter commented 8 years ago
This is fixed now see 
http://jquery-datatables-column-filter.googlecode.com/svn/trunk/issue37.html . 
Does these functions work the same way when columns are hidden via properties 
and when colvis plugin is used.
When I have applied this patch, filtering breaks when it is used with colVis 
plugin. I have fixed this too but probably I will need to investigate it 
further.

Thanks,
Jovan

Original comment by joc...@gmail.com on 31 Oct 2011 at 8:37

GoogleCodeExporter commented 8 years ago
I'm closing this issue as there is no further response on this.

Original comment by joc...@gmail.com on 12 Feb 2012 at 7:29

GoogleCodeExporter commented 8 years ago
This issue is still not fixed. See attachment

Original comment by qaiser...@gmail.com on 19 Feb 2012 at 3:20

Attachments:

GoogleCodeExporter commented 8 years ago
Confirmed. Issue is still not fixed. I will note that I'm using the ColVis 
plugin as well. However everything works fine with that - I'm just trying to 
hide an ID column at the start of the table with bVisible.

Original comment by mali...@gmail.com on 8 Apr 2012 at 4:34

GoogleCodeExporter commented 8 years ago
I had issues too using bVisible to hide a column, but in my case the problem 
was solved when I used the function fnSetColumnVis() after table 
initialisation, instead of just setting the bVisible flag.

Hope it helps to you as well.

Original comment by jildert....@gmail.com on 19 Apr 2012 at 9:45

GoogleCodeExporter commented 8 years ago
Please, update this bug to open, it is not yet fixed.

Original comment by jose.nob...@gmail.com on 14 May 2012 at 9:27

GoogleCodeExporter commented 8 years ago
I'm also having this issue. Been trying to fix with using fnSetColumnVis() 
function instead of flag but no luck yet.

Original comment by adamgate...@gmail.com on 20 May 2012 at 7:15

GoogleCodeExporter commented 8 years ago
I am also having this problem. If I run the table without hiding any columns it 
works as expected. However, if I hide column 0 using {"bVisible": false, 
"aTargets" : [0]} then things start getting funky. Hiding the first column 
increments the column numbers by 1, so when I search with criteria in column 1, 
it gets posted as sSearch_2. Also search criteria in the last column, you would 
think would just get bumped out of range, but it gets posted as sSearch.

Original comment by matthew....@gmail.com on 20 Jun 2012 at 6:54

GoogleCodeExporter commented 8 years ago
I have this problem as well. Exactly as described by the previous commentors.

Original comment by dragon...@gmail.com on 21 Jun 2012 at 7:25

GoogleCodeExporter commented 8 years ago
I tried the fnSetColumnVis solution and it didn't help me either.

Original comment by dragon...@gmail.com on 21 Jun 2012 at 7:35

GoogleCodeExporter commented 8 years ago
Since this issue is marked "fixed", and it's clearly NOT fixed, I just opened a 
new one.
http://code.google.com/p/jquery-datatables-column-filter/issues/detail?id=88

Original comment by gbirchme...@connamara.com on 24 Aug 2012 at 2:21

GoogleCodeExporter commented 8 years ago
This issue is a simple matter of initialization.  You must hide the column 
after you attach the column filter plug in:

$("#tblItemList").dataTable().columnFilter();
$("#tblItemList").dataTable().fnSetColumnVis(0, false);

This works just fine.

Original comment by Dean.De...@gmail.com on 23 Jun 2015 at 5:55