Skip to content

Commit

Permalink
Fix get primaryKey in action wire:key
Browse files Browse the repository at this point in the history
  • Loading branch information
luanfreitasdev committed Dec 6, 2023
1 parent 1f07a96 commit 456ebec
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions resources/views/components/row.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
])

@includeWhen($radio, 'livewire-powergrid::components.radio-row', [
'attribute' => $row->{$radioAttribute},
'attribute' => data_get($row, $radioAttribute),
])

@includeWhen($checkbox, 'livewire-powergrid::components.checkbox-row', [
'attribute' => $row->{$checkboxAttribute},
'attribute' => data_get($row, $checkboxAttribute),
])

@foreach ($this->visibleColumns as $column)
Expand All @@ -44,10 +44,9 @@
wire:key="row-{{ $column->field }}"
>
<div class="pg-actions">
<!-- Render Action -->
@if (filled(data_get($row, 'actions')) && $column->isAction)
@foreach (data_get($row, 'actions') as $key => $action)
<div wire:key="action-{{ $row->id }}-{{ $key }}">
<div wire:key="action-{{ data_get($row, $primaryKey) }}-{{ $key }}">
{!! $action !!}
</div>
@endforeach
Expand Down

0 comments on commit 456ebec

Please sign in to comment.