Filter in header not working for fixed columns

Filter in header not working for fixed columns

stevensi1018stevensi1018 Posts: 10Questions: 3Answers: 0
edited December 2018 in Free community support

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)

Replies

  • awelchawelch Posts: 38Questions: 1Answers: 3

    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 working select element. One possible solution is to put the filters somewhere outside of the table.

  • stevensi1018stevensi1018 Posts: 10Questions: 3Answers: 0

    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

  • kthorngrenkthorngren Posts: 20,309Questions: 26Answers: 4,770

    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 the select to keep track of the columns.

    Kevin

  • stevensi1018stevensi1018 Posts: 10Questions: 3Answers: 0

    Thanks, I got it working with your code

This discussion has been closed.