Individual Column Searching (Text Inputs) - Bug / Depreciation

Individual Column Searching (Text Inputs) - Bug / Depreciation

acareyacarey Posts: 3Questions: 2Answers: 0
edited June 2016 in Free community support

I have recently upgraded to DataTables v-1.10.12 from v-1.9.4.
The change in what was 'ColumnFilter' which was very easy to implement on tables has been replaced with 'Individual Column Searching (Text Inputs).

I however implemented this column searching but also have stateSave on the table.

The problem being that when I search an individual column and then exit / refresh the page, the stateSave works, but the text entered in the text box doesn't stay there and is replaced by the placeholder.

Is there any way to fix this?

            var Datatable1 = $('#datatable1').DataTable({
                dom: 'Blftpir',
                "order": [[ 0, 'asc' ]],
                "displayLength": 25,
                "lengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]],
                colReorder: true,
                stateSave: true,
                //responsive:true,
                buttons: [
                    'copy',
                    'csv',
                    'pdf',
                    'print',
                ],

            });

           // Add text to footer cell if it has text in it
            $('#datatable1 tfoot th').each( function () {
                var title = $(this).text();
                if (title) {
                    $(this).html( '<input type="text" placeholder="Filter '+title+'" />' );
                }
            } );

            // DataTable
            var table = $('#datatable1').DataTable();

            // Apply the search
            table.columns().every( function () {
                var that = this;

                $( 'input', this.footer() ).on( 'keyup change', function () {
                    if ( that.search() !== this.value ) {
                        that
                            .search( this.value )
                            .draw();
                    }
                } );
            } );
This discussion has been closed.