How to do individual column filters with state save?

How to do individual column filters with state save?

acareyacarey Posts: 3Questions: 2Answers: 0

I have upgraded from an older version of DataTables (1.9.4) to the newer (v-1.10.12).

In my tables I used to use the ColumnFilter to set searchable fields on individual columns.

I can't find any documentation in the newer DataTables for this except for - "Individual column searching (text inputs)"
Link:
https://datatables.net/examples/api/multi_filter.html

I also am using state save on my DataTables.

My problem is that if I filter a column and then leave / refresh the page, the state save works, but the filtered column has its original placeholder text in it so the end user does not know it is being filtered.

As I have taken this code directly from the DataTables site I am assuming someone must have came across this problem at some point.

Is there any fix or workaround for this?

Thanks in advance,

Andrew

Answers

  • Tom (DataTables)Tom (DataTables) Posts: 139Questions: 0Answers: 26
    edited July 2016

    The example you linked doesn't support stateSaving at the moment. The filtering state is saved, but it won't restore the value into the input / select when the page is reloaded

    You have two options-

    1. Use YADCF
    2. You could modify that example to restore the values- which can be done using state.loaded() to get the loaded values

    Thanks

    Tom

This discussion has been closed.