Filter in header not working for fixed columns
Filter in header not working for fixed columns
stevensi1018
Posts: 10Questions: 3Answers: 0
I have a filter header with select elements but when the column is using the fixedColumn extension, the filter won,t work.
Here is a test case: http://live.datatables.net/jibaqoje/1/edit
If you filter on the Position (not fixed), it works but it doesn't work on the name column (fixed)
This discussion has been closed.
Replies
Check the notes in the Additional-complexity section for the FixedColumns extension. A separate table is created and overlaid on top of the original table for the static column(s). This separate table is a clone of the original, including the .filterhead portion with the select elements (with their unique ids!) since FixedColumns is initialized after the initComplete function fires. However, the event listeners are not cloned, so the cloned table and
select
element with no event listeners is covering the workingselect
element. One possible solution is to put the filters somewhere outside of the table.Thanks, I read a little bit about that but if I don't want to put the filters outside my table ? I like them where they are now, pretty easy to filter
Awelch's comments are correct. You will need to change your select input searches to look more like this FixedColumn column input example:
https://datatables.net/extensions/fixedcolumns/examples/styling/col_filter.html
I created an example that works:
http://live.datatables.net/zoyafove/1/edit
Note the use of the
data-index
attribute in theselect
to keep track of the columns.Kevin
Thanks, I got it working with your code