Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Jandepiel opened this issue Dec 4, 2019 · 0 comments

Comments

@Jandepiel
Copy link

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 %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant