How can I change the color of TextColumn based on other field value? #15789
Answered
by
leandrocfe
Mohamed5550
asked this question in
Help
-
|
Hi Suppose I have a model with two properties, A and B I want both columns to be colored in red when A < 0 and green when A >= 0 How to achieve this? Thanks |
Beta Was this translation helpful? Give feedback.
Answered by
leandrocfe
Mar 6, 2025
Replies: 1 comment
-
|
Inject ->color(fn (YourModel $record): string => $record->a >= 0 ? 'success' : 'danger') |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Mohamed5550
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Inject
$record