Hi, I hope this helps. I have been working on an app for over a year using this great grid, (thanks a lot for it), and spent a long time making things work together. So in this installment, I will list one fix I found that people seem to have trouble with. I also will list another one on a second post. Actually I have a lot of fixes/workarounds and will post what I can. These may or may not exist but I wanted to give back from the community where I have taken a lot of help from.
I have 1.9.2 datatables, 1.5.0 Columnfilter, Colvis 1.0.8, and colreorder is 1.0.6.
Problem: You hide some columns, reorder them, or both and then try to use the column filter, but the index is off by a given amount. If you are using NULL for some of the filters as one guy had an issue with but no answer and I also had an issue, that will throw it off so you are typing in a column and it is searching somewhere else.
Solution, for me it works:
in Columnfilter find
Replace that with this
What this does whether you are hiding a column or not, it will find the index of the TH because like me, the NULL filter was throwing off the count. The parent is a bit much but works right? It looks at the TH parent of the input to give the actual column number that is shown and not the count index of the input which it was looking at. I had say NULL, input, NULL, input, input and that was messing things up for others I think also.
Hope that helps. Don't know but I think this should be added in the actual js file so nobody struggles with this since the _fnVisibleToColumnIndex is an API function and will always be there. If you never hid a column it will return it just fine.
FYI I adapted this from this example.
http://datatables.net/release-datatables/extras/ColReorder/col_filter.html
Enjoy
I have 1.9.2 datatables, 1.5.0 Columnfilter, Colvis 1.0.8, and colreorder is 1.0.6.
Problem: You hide some columns, reorder them, or both and then try to use the column filter, but the index is off by a given amount. If you are using NULL for some of the filters as one guy had an issue with but no answer and I also had an issue, that will throw it off so you are typing in a column and it is searching somewhere else.
Solution, for me it works:
in Columnfilter find
oTable.fnFilter(this.value, _fnColumnIndex(index), regex, smart); //Issue 37on line 161 roughly.
Replace that with this
oTable.fnFilter( this.value, oTable.oApi._fnVisibleToColumnIndex(oTable.fnSettings(), $(this).parent().parent().index() ), regex, smart );
What this does whether you are hiding a column or not, it will find the index of the TH because like me, the NULL filter was throwing off the count. The parent is a bit much but works right? It looks at the TH parent of the input to give the actual column number that is shown and not the count index of the input which it was looking at. I had say NULL, input, NULL, input, input and that was messing things up for others I think also.
Hope that helps. Don't know but I think this should be added in the actual js file so nobody struggles with this since the _fnVisibleToColumnIndex is an API function and will always be there. If you never hid a column it will return it just fine.
FYI I adapted this from this example.
http://datatables.net/release-datatables/extras/ColReorder/col_filter.html
Enjoy