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

Add checked to a user column selection #436

Merged
merged 2 commits into from
Sep 5, 2021

Conversation

Majkie
Copy link
Contributor

@Majkie Majkie commented Aug 15, 2021

Add checked to a user column selection.

To reduce large datatables it should be possible to display only selected fields by default and leave rest hidden unless user wants to display them.

Column::make('Name')->selected(),

Column::make('Created At'),

This will only show Name column meanwhile Created At stays hidden but still possible to display in columns dropdown.

@vmosoti
Copy link

vmosoti commented Aug 18, 2021

Really nice feature to have

@rappasoft
Copy link
Owner

Would this not be a breaking change? It would cause everyone's columns to be hidden unless they added that method call.

@Majkie
Copy link
Contributor Author

Majkie commented Aug 24, 2021

Didn't think this far. I'll try to test and fix it.

@rappasoft
Copy link
Owner

The shown cols are also stored in a session so it might get hairy on what's stored in the session vs the code, etc.

@Majkie
Copy link
Contributor Author

Majkie commented Aug 24, 2021

I can't think of anything but adding something like public bool $usesSelected = false; which would be set to true if even one of many columns had selected(). And based on value of usesSelected, add $column->isSelected() to the collection filter.

@rappasoft
Copy link
Owner

Could work, this really only matters for the first time the table is loaded for the other. Because it saves it to the session and is then loaded from that every other time.

@rappasoft rappasoft added the Awaiting Next Release Currently merged into development awaiting a release to master label Sep 3, 2021
@rappasoft rappasoft mentioned this pull request Sep 5, 2021
@rappasoft rappasoft merged commit 4f1c076 into rappasoft:master Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Next Release Currently merged into development awaiting a release to master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants