-
-
Notifications
You must be signed in to change notification settings - Fork 344
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
[Feature Request]: conditional deselected() #1842
Comments
Good suggestion. I'm in the process of actually updating the Column behaviours, so will see if this can be added in at the same time. |
So, introducing Where you use non-table properties to determine whether or not to select the column, is straight forward. Making it more complex: So are you happy with just a straight forward callback, e.g. Column::make('Something', 'description')
->deselectedIf(fn() => Auth::user()->can('Do-Something'))
->sortable(), and Column::make('Something Else', 'name')
->selectedIf(fn() => 1 > 2)
->sortable(), I can't see any use case for any other parameter other than a generic callback |
It looks great. This is exactly what I'm looking for. Thanks so much! |
No problem, I'll need to write docs and tests, but should be done by the end of the week |
Just linking in the PR, I'll need to double check it all before I can do a release, but it's all on-track as you can see! |
@markebjones - should be present now as of v3.4.6 |
Great. Thank you. I will test it over the weekend! |
Seems to work perfectly. Thank you. :) |
Overview
I would like to be able to conditionally determine if the column should be deselected, or not, similarly to how I can conditionally determine if the column should be hidden, or not.
Great repo, obviously, thanks so much!
Detailed explanation
My suggestion is to either:
deselected()
to support an optional boolean argument that would deselect if true, with a default of truedeselectIf()
with a mandatory boolean argument that would deselect if trueNotes
No response
The text was updated successfully, but these errors were encountered: