Dynamic Customise Columns for Table
I have checked the docs and I don't think it exists.
Am I able to add some kind of filter / option so I can select which fields I want to see in a table.
For example I have a table with the following columns:
Id | Name | Email | Address 1 | Address 2 | Country | Zip | Phone | Mobile | Actions
Some times I only care about seeing the Name, email and Actions.
Is there some functionality so I can hide the other fields?
Solution:Jump to solution
Sure, chain this method to the table field ->toggleable(isToggledHiddenByDefault: true)
2 Replies
Solution
Sure, chain this method to the table field ->toggleable(isToggledHiddenByDefault: true)
So the final snippet will be
Tables\Columns\TextColumn::make('phone')
->searchable()
->toggleable(isToggledHiddenByDefault: true),