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

Persistence doesn't save column visibility (reappearing hidden columns) #3724

Closed
rathboma opened this issue Apr 28, 2022 · 2 comments
Closed
Labels
Possible Bug A possible bug that needs investigation

Comments

@rathboma
Copy link
Contributor

rathboma commented Apr 28, 2022

Tabulator persistence mode is not saving column visibility:

persistence-not-hidden

Steps to reproduce:

  • hide columns
  • refresh page

expected:

  • columns should be hidden

actual:

Config used:

	persistence: { columns: true },
	persistenceID: '1'
@rathboma rathboma added the Possible Bug A possible bug that needs investigation label Apr 28, 2022
@JacobGralinski
Copy link

Hi @rathboma I found that explicitly stating visibility on each column allows that data to persist. Not sure if it's supposed to persist without it being a part of the column config, so it could still be a bug in that sense.

visible: true visible: false

@olifolkerd
Copy link
Owner

olifolkerd commented May 1, 2022

Hey @rathboma

This was happening because the persistence module was only tracking the values of keys that had actually been set in the column definitions.

As the documentation clearly states setting colums:true should include the visibility, i have just pushed a fix for this to the master branch and will include it in todays patch release.

It will now forcibly include the column visibility if columns is set to true.

@JacobGralinski as a helpful hint for you, if you need to set a value on every column, then rather than setting it manually on every column, you can use the columnsDefaults option in the constructor, any value in this object will be applied to all columns:

var table = new Tabulator("#example-table", {
    columnDefaults:{
        visible:true,    },
});

Cheers

Oli :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Possible Bug A possible bug that needs investigation
Projects
None yet
Development

No branches or pull requests

3 participants