Lipe0_0
How use a widget table on modal?
I try create widget table and call on blade,
it works, but when close modal and open again break everything. Have this error in console:
livewire.js Uncaught Could not find Livewire component in DOM tree
Uncaught (in promise) Could not find Livewire component in DOM tree
I try this:
table:
->modalContent(function ($record) {
$uniqueId = 'analysis-' . $record->id . '-' . uniqid();
return view('filament.analist.pages.document-analysis',
[
'record' => $record,
'uniqueId' => $uniqueId
]);
})
blade:
<strong>{{ $record->question }}</strong>
@livewire('App\Filament\Analist\Widgets\ListDocumentReleases', ['record' => $record], key($uniqueId))
widget:
<?php
namespace App\Filament\Analist\Widgets;
use App\Models\Document;
use Filament\Tables;
use Filament\Tables\Table;
use Filament\Widgets\TableWidget as BaseWidget;
class ListDocumentReleases extends BaseWidget
{
public $record;
public function table(Table $table): Table
{
return $table
->query(Document::getDocumentList($this->record))
->heading('')
->columns([
Tables\Columns\TextColumn::make('last_modify_at'),
Tables\Columns\TextColumn::make('original_name')
->label(__('Original Name'))
->icon('heroicon-o-document')
->url(fn ($record) => $record->link)
->openUrlInNewTab()
->color('gray'),
Tables\Columns\TextInputColumn::make('sed_answer')
->disabled(),
Tables\Columns\TextInputColumn::make('student_answer')
->disabled(),
Tables\Columns\TextInputColumn::make('analist_answer'),
])
->paginated(false);
}
}
17 replies