Skip to content

skipLoadFromLocalStorage still shows columns with ->setHiddenByDefault(true) #8

@Jandepiel

Description

@Jandepiel

I have a button on my page to reset all filter input above every column. This button has a parameter ‘clear’. I dont want to show every column of my table and I want the user to choose which ones. By default I want these columns to be disabled with ->setHiddenByDefault(true)
When I press this button, the table shows all columns. Even the ones who are disabled

Code now:

let table = new KilikTable("{{ table.id }}", "{{ table.path }}", JSON.parse('{{ table.options | json_encode | raw }}'));
table.afterReload = function () {
// Init plugins required for this table
};

{% if app.request.get('clear') == 'admin_table%}
table.skipLoadFromLocalStorage = true;
//tableLicenseOverzichtProduct.hiddenColumns = tableLicenseOverzichtProduct.defaultHiddenColumns;
{% endif %}
table.init();

The problem is that hiddenColumns is never set.

Temporary fix:
{% if app.request.get('clear') == 'admin_table' %}
table.skipLoadFromLocalStorage = true;
table.hiddenColumns = table.defaultHiddenColumns;
{% endif %}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions