jjordaan
jjordaan

Reputation: 23

The column state is not remembered

Good day.

I'm using datatables with the yadcf plugin. The data is server side. When enabling state to true, the column selections are not remembered.

My table settings:

let table = $('#data-table').DataTable({
        // NOTE: https://datatables.net/forums/discussion/61967/duplicate-the-showing-1-to-10-of-xx-entries-to-top-of-the-table
        // set DOM to also place info (i) at top; i=info, f=dropdown pagefilter, l=search, p=pagination
        "dom": 'B<"top"ifl<"clear">>rt<"bottom"ip<"clear">>',
        serverSide: true,
        ajax: 'trademark/data-source',
        order: [[2, 'asc']],
        stateSave: true,
        footerCallback: function () {
            $('#data-table tfoot').remove();
        },
        lengthMenu: [[10, 25, 50, 100, 500, 1000], [10, 25, 50, 100, 500, 1000]],
        displayLength: 10,
        select: true,
        ...

    // Initialise data filter
    yadcf.init(table, [
            { column_number : 3, html_data_type: "text", sort_as: "alphaNum", filter_reset_button_text: false, filter_type: "multi_select", select_type: 'select2' },
            { column_number : 4, html_data_type: "text", sort_as: "alphaNum", filter_reset_button_text: false, filter_type: "multi_select", select_type: 'select2' }
...
        ]
    );

Regards, Jarrett

Followed the instructions at https://yadcf-showcase.appspot.com/DOM_Ajax_Multiple_1.10.html. But even that example does not have state working.

Upvotes: 0

Views: 20

Answers (0)

Related Questions