[Feature Request]: Add a hideValueIf option for Column. #1483
Replies: 5 comments 1 reply
-
as discussed, suggest a hideValueIf approach |
Beta Was this translation helpful? Give feedback.
-
Assigned to @amshehzad initially, but can review |
Beta Was this translation helpful? Give feedback.
-
Should add the method hideValueIf() with a callback: hideValueIf(callback $callback) The end code should add the usual functions has/get/set for the hideValueIf If the hideValueIf callback returns false, the value should be returned This should not use classes to hide the content, but actually remove the content, and return an empty |
Beta Was this translation helpful? Give feedback.
-
In the meantime, this approach would work, in this example, it'll hide a "name" that is "Test123". You could also push the row/value to an external method, and use that to return the value to display. Column::make('Name', 'name')
->format(fn($value, $row, Column $column) => ($row->name == 'Test123' ? '' : $row->name)), |
Beta Was this translation helpful? Give feedback.
-
For anyone stumbling across this that needs a permission-based LinkColumn as I did, you can do the same as @lrljoe suggested using the
Yes, there's still an |
Beta Was this translation helpful? Give feedback.
-
Overview
I think it'll be nice to pass the current row to
hideIf
so we can hide the column based on the row value e.g if a row is created_by admin, hide itDetailed explanation
No response
Notes
No response
Beta Was this translation helpful? Give feedback.
All reactions