Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LazyChild with detail row #1342

Merged
merged 1 commit into from
Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions resources/views/components/table/detail.blade.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
@php
$rulesValues = $actionRulesClass->recoverFromAction($row, 'pg:rows');
@endphp
<template
x-cloak
x-if="detailState"
>
@if(data_get($setUp, 'detail.state.' . $rowId))
@php
$rulesValues = $actionRulesClass->recoverFromAction($row, 'pg:rows');
@endphp

<td colspan="999">
@if (filled($rulesValues['detailView']))
@includeWhen(data_get($setUp, 'detail.state.' . $row->{$primaryKey}),
Expand All @@ -26,4 +24,4 @@
)
@endif
</td>
</template>
@endif
10 changes: 3 additions & 7 deletions src/Livewire/LazyChild.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class LazyChild extends Component

public string $radioAttribute = 'id';

private Collection $data;
public Collection $data;

public array $theme;

Expand All @@ -38,10 +38,8 @@ class LazyChild extends Component

public string|int $childIndex;

public function mount(Collection $data): void
public function mount(): void
{
$this->data = $data;

$this->resolveDetailRow($this->data);
}

Expand All @@ -56,8 +54,6 @@ public function afterToggleDetail(string $id, string $state): void

public function render(): View
{
$data = $this->data;

return view('livewire-powergrid::livewire.lazy-child', compact('data'));
return view('livewire-powergrid::livewire.lazy-child');
}
}
Loading