For IconColumn, only show boolean icon when true?
Hi there, I have an icon column (see screenshot) but I only want an icon to display when the value is true.
How can I do this?
6 Replies
What's your code? Probably using
->boolean()
?
Try something like this:
->icon(fn ($state) => $state ? 'your-icon' : null)
This is the result:
Associated code:
No need for
->boolean()
Removing
->boolean()
results in the same visual appearance.Can you try
->falseIcon(null)
?
Not sure where that default false
Icon is coming from π€
I think ->icon()
should be all you need π€->falseIcon(null)
did not change the visual appearance
I don't know where it's coming from either π°