In a table, how to open related resource in modal instead of ViewPage #14663
Unanswered
gregoryloichot
asked this question in
Help
Replies: 1 comment
-
OK guys, I've worked on it… and got blocked… Tables\Columns\TextColumn::make('name')
PostColumn::make('post.name') The column is defined like: <?php
namespace App\Tables\Columns;
use Filament\Tables\Columns\Column;
class PostColumn extends Column
{
protected string $view = 'tables.columns.posts-column';
} And finally the view : @foreach($getRecord()->posts as $p)
<x-filament::modal
id="post-{{$p->id}}"
icon="heroicon-o-information-circle"
icon-color="danger"
alignment="center"
sticky-header
sticky-footer
width="5xl"
:close-by-clicking-away="false"
:close-button="false">
<x-slot name="trigger">
<x-filament::button
color="danger"
icon-position="after"
outlined
badge-color="danger">
{{$id->name}}
</x-filament::button>
</x-slot>
<x-slot name="heading">
Details
</x-slot>
Content …
</x-filament::modal>
@endforeach It works perfectly, until y add actions to the table, like : $table->actions([
Tables\Actions\ViewAction::make()->button()->hiddenLabel(),
]) The model no longer cannot be open and there is a JS error on the page : |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Package
Table builder
Package Version
v3.2
How can we help you?
Hello,
I have a table with a column defined as displaying a relationship. For example:
I want the
post.name
to be clickable so the user can view the post's detail. This is ok by:The
PostResource
has aViewPage
defined. However, in this case, I want the URL to be opened in a modal (as if theViewPage
was not defined in thePostResource
).How can I achieve this?
Thank you for your help.
Beta Was this translation helpful? Give feedback.
All reactions