-
Notifications
You must be signed in to change notification settings - Fork 32
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
initialHiddenColumnIds not working #213
Comments
Same issue here, const { pluginStates } = table.createViewModel(columns);
const { hiddenColumnIds } = pluginStates.hideColumns;
$hiddenColumnIds = ['age']; Here's a working example: |
I found the issue, this happens when this code is called const ids = flatColumns.map((c) => c.id);
let hideForId = Object.fromEntries(ids.map((id) => [id, false]));
$: $hiddenColumnIds = Object.entries(hideForId)
.filter(([, hide]) => hide)
.map(([id]) => id); Basically, by using flatCloumns to get columns ids it will replace the existing hidden list After I have looked into the codebase, I think the hiddenColumnIds is derived from flatColumns but then returned as readable Here's an example of making an object and set the visibility based on |
In the config object passed to
addHiddenColumns
, settinginitialHiddenColumnIds
to an array of column id's should result in the specified columns to be hidden by default.I wasn't able to get this functionality working in my application or the REPL.
To reproduce, go to the Kitchen Sink REPL and add the following:
I'd expect the age column to be hidden by the time the component mounts. Any thoughts?
Update:
See @moalamri 's comment below for workaround!
The text was updated successfully, but these errors were encountered: