F
Filament12mo ago
Quin.

Hidden Column on $record

I want to hide a column when $record->description is empty anyone has a idea how to? because i couldn't assignee $record to the hidden function Just like in the tooltip
Tables\Columns\IconColumn::make('domainextension.description')->label('Description')->translateLabel()
->tooltip(function ($record) { return DomainExtension::find($record->domain_extensions_id)->description; })
->alignCenter()
->hidden(function ($record) { dd($record); })
->icon('heroicon-o-information-circle')
Tables\Columns\IconColumn::make('domainextension.description')->label('Description')->translateLabel()
->tooltip(function ($record) { return DomainExtension::find($record->domain_extensions_id)->description; })
->alignCenter()
->hidden(function ($record) { dd($record); })
->icon('heroicon-o-information-circle')
4 Replies
LeandroFerreira
LeandroFerreira12mo ago
Table column visibility cannot be controlled based on row values; however, you can modify the row value using formatStateUsing to change the presentation. https://filamentphp.com/docs/3.x/tables/columns/text/#custom-formatting
Quin.
Quin.OP12mo ago
This doesn't work for a Icon Column correct?
Quin.
Quin.OP12mo ago
Ahh ty got it!
Want results from more Discord servers?
Add your server