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); } }
14 Replies
Lipe0_0
Lipe0_0OP6mo ago
up
awcodes
awcodes6mo ago
Modals don’t have widgets but since widgets are just livewire components you could possible just render it in the modal view. Assuming you pass all the necessary data to it.
Lipe0_0
Lipe0_0OP6mo ago
that's the way i'm doing, but when I close the modal and open it again, all components of the modal are frozen, and the columnInputs of widgetTable are returning empty
No description
No description
Lipe0_0
Lipe0_0OP6mo ago
in the second screenshot the modal don't closes anymore
awcodes
awcodes6mo ago
Do you have a repo you could share? Having trouble piecing it all together from the code you shared.
Lipe0_0
Lipe0_0OP6mo ago
I can't send the repo, but I can send screenshots of the code
Lipe0_0
Lipe0_0OP6mo ago
that is my resource where I call the view
No description
Lipe0_0
Lipe0_0OP6mo ago
that is my blade
No description
Lipe0_0
Lipe0_0OP6mo ago
and that is my widget Table
No description
awcodes
awcodes6mo ago
Hmm. Only thing that looks out of place to me is the ->query() that should be Model::query(). It’s the base query not the modified query. Might possibly need a single element on the view. Ie, wrapping it all in a single Div.
Lipe0_0
Lipe0_0OP6mo ago
I apply the fixes, but the problems stills the same...
Lipe0_0
Lipe0_0OP6mo ago
this video explain the problem
awcodes
awcodes6mo ago
Will have to look at it later, can’t open that attachment on my phone.
Lipe0_0
Lipe0_0OP6mo ago
no problems, thanks a lot for all the help
Want results from more Discord servers?
Add your server