Filament Table column hidden with condition
I have this two columns:
TextColumn::make('column_one')
->sortable(),
TextColumn::make('column_two')
->sortable()
->searchable(),
If column_one equals to 1, then hide column_one and show column_two
If column_one different from 1, then hide column_two
Solution:Jump to solution
You should use this https://filamentphp.com/docs/3.x/tables/columns/getting-started#calculated-state
You can't show/hide columns by row values...
4 Replies
Solution
You should use this https://filamentphp.com/docs/3.x/tables/columns/getting-started#calculated-state
You can't show/hide columns by row values
Thank you for replying π
And with this state() function, how can i trigger the hide() for current element or any other element?
What Leandro means is
Only don't use sortable, because that is not gonna work.
Thank you @Leandro Ferreira and @Tieme
This solves one of my problems π
Thank you π
Will mark as solved