Replies: 5 comments 1 reply
-
A Column does not accept hideIf based on the row value, as otherwise you'd have a broken DOM. Otherwise you're saying Use the classes to determine whether or not to display the button, or use a custom view for the Column. |
Beta Was this translation helpful? Give feedback.
-
How can I make custom view for this column? |
Beta Was this translation helpful? Give feedback.
-
#Using a view Column::make('Name')
->format(
fn($value, $row, Column $column) => view('my.custom.view')->withValue($value)
), As a shorthand you can use the following: Column::make('Name')
->view('my.custom.view'), You will have access to $row, $value, and $column from within your view. You can then have complete control over whether each of the Buttons is displayed, how they're displayed etc |
Beta Was this translation helpful? Give feedback.
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
Hi, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I want to show some button if some status = 201.
I Try use:
LinkColumn::make('Kwalifikacja') ->title(fn($row) => 'Kwalifikacja ') ->location(fn($row) => '#') ->attributes(function($row) { return [ 'class' => 'btn btn-primary btn-sm', 'wire:click.prevent' => 'viewDetailModal('.$row->id.')' ]; }) ->hideIf(fn($row) => ($row->status === 201 ? 1 : 0)),
but I have error: Cannot assign Closure to property Rappasoft\LaravelLivewireTables\Views\Column::$hidden of type bool
How can I do this?
BR
Beta Was this translation helpful? Give feedback.
All reactions