Samus_Aran
Samus_Aran
FFilament
Created by Samus_Aran on 6/16/2024 in #❓┊help
Form with Textarea on custom widget causing JS errors
Yes 🙂
4 replies
FFilament
Created by Samus_Aran on 6/16/2024 in #❓┊help
Form with Textarea on custom widget causing JS errors
It appears that the issue is somehow caused by the fact that the Resource defines an infolist, which gets rendered on my ViewPage 🤔
4 replies
FFilament
Created by Samus_Aran on 6/16/2024 in #❓┊help
Problems closing a parent modal
I still would be interested in an answer, but I found a workaround that is sufficient for my use case: First I was using the feature described here: https://filamentphp.com/docs/3.x/actions/modals#adding-an-action-to-custom-modal-content. This way I could register a proper DeleteAction and at least pass it to the modal blade View. I then removed the Section Component from my infolist and instead wrapped the whole InfoList-Livewire-Component in Filaments Section Blade Component: https://filamentphp.com/docs/3.x/support/blade-components/section. There I could place the Action buttons using the endHeader Slot. I ended up with the identical looking UI, but my Actions are now definied within the ViewAction and passed down to the modalContent.
2 replies
FFilament
Created by Samus_Aran on 6/7/2024 in #❓┊help
Using an Infolist-Action with another infolist in it.
sorry
12 replies
FFilament
Created by Samus_Aran on 6/7/2024 in #❓┊help
Using an Infolist-Action with another infolist in it.
@krekas I now did the following workaround:
TextEntry::make('client.name')
->prefixAction(fn($record) => Action::make('clientDetails')
->icon('heroicon-m-clipboard')
->modalContent(fn($record) => view('client.show', ['client' => $record->client]))
)
TextEntry::make('client.name')
->prefixAction(fn($record) => Action::make('clientDetails')
->icon('heroicon-m-clipboard')
->modalContent(fn($record) => view('client.show', ['client' => $record->client]))
)
The Blade View client.show then renders a Livewire component with an Infolist 🤷‍♂️
12 replies
FFilament
Created by Samus_Aran on 6/7/2024 in #❓┊help
Using an Infolist-Action with another infolist in it.
@krekas Yes, I have an Infolist and I want to use a prefixAction on a TextEntry to open a modal that contains another infolist with more information. And since i have the infolist() method available on this Action to pass an infolist into it, I would assume that there should also be a way to provide the data to the infolist
12 replies
FFilament
Created by Samus_Aran on 6/7/2024 in #❓┊help
Using an Infolist-Action with another infolist in it.
@krekas a state() method is also not available 🤔
12 replies
FFilament
Created by Samus_Aran on 6/7/2024 in #❓┊help
Using an Infolist-Action with another infolist in it.
In OrderResource.php:
public static function infolist(Infolist $infolist): Infolist
{
return $infolist
->schema([
Infolists\Components\TextEntry::make('client.name')
->prefixAction(fn($record) => Action::make('copyCostToPrice')
->icon('heroicon-m-clipboard')
->record($record->client) // <- this doesn't exist
->infolist([
Infolists\Components\TextEntry::make('email'),
Infolists\Components\TextEntry::make('phone')
])
),
]);
}
public static function infolist(Infolist $infolist): Infolist
{
return $infolist
->schema([
Infolists\Components\TextEntry::make('client.name')
->prefixAction(fn($record) => Action::make('copyCostToPrice')
->icon('heroicon-m-clipboard')
->record($record->client) // <- this doesn't exist
->infolist([
Infolists\Components\TextEntry::make('email'),
Infolists\Components\TextEntry::make('phone')
])
),
]);
}
12 replies
FFilament
Created by Samus_Aran on 6/7/2024 in #❓┊help
Using an Infolist-Action with another infolist in it.
@krekas No. That's the confusing part. Method Filament\Infolists\Components\Actions\Action::record does not exist.
12 replies
FFilament
Created by Samus_Aran on 6/6/2024 in #❓┊help
Use recordAction() In a Table Widget
@awcodes Yes it looks like it. I am currently toying around with this and it seems like whatever Action I put into recordAction() needs to be also present in actions() of the table. So it seems that I need to hide it with CSS
19 replies
FFilament
Created by Samus_Aran on 6/6/2024 in #❓┊help
Use recordAction() In a Table Widget
@awcodes haha yes, this works 😄 But then it doesn't open in a modal 😄
19 replies
FFilament
Created by Samus_Aran on 6/6/2024 in #❓┊help
Use recordAction() In a Table Widget
@awcodes okay, I added a view page for my invoices and checked that it is working. I then added ->recordAction(fn ($record) => InvoiceResource::getUrl('view', ['record' => $record])) to my table which results in an Alpine Expression when I click the table row: Alpine Expression Error: Unexpected token ':' Expression: "$wire.http://sampleapp.test/projects/1/invoices/1('1')"
19 replies
FFilament
Created by Samus_Aran on 6/6/2024 in #❓┊help
Use recordAction() In a Table Widget
let me try this...
19 replies
FFilament
Created by Samus_Aran on 6/6/2024 in #❓┊help
Use recordAction() In a Table Widget
I did that already. Then clicking the row doesn't work anymore. It disables the action entirely
19 replies
FFilament
Created by Samus_Aran on 6/6/2024 in #❓┊help
Use recordAction() In a Table Widget
@awcodes I could make my View Action on the right de facto invisible like this:
ViewAction::make()
->hiddenLabel(true)
->icon(false)
ViewAction::make()
->hiddenLabel(true)
->icon(false)
But then I have some whitespace, because Filament still renders the table column for the actions 😄
19 replies
FFilament
Created by Samus_Aran on 6/6/2024 in #❓┊help
Use recordAction() In a Table Widget
Yes, I have this default behaviour out of the box on all tables on Resource List Views. But I am in a TableWidget on the view page of a different resource...
19 replies
FFilament
Created by Samus_Aran on 6/6/2024 in #❓┊help
Use recordAction() In a Table Widget
@awcodes the recordAction() method only accepts a string. I figured out that this is working:
->actions([
ViewAction::make()
])
->recordAction('view')
->actions([
ViewAction::make()
])
->recordAction('view')
But now I have a clickable row AND a 'View' Action link on the right.
19 replies
FFilament
Created by Samus_Aran on 6/6/2024 in #❓┊help
Use recordAction() In a Table Widget
I can do ->recordAction(Table\Actions\ViewAction::class) but then I get an Exception that a view() method is missing on my component. And I don't know what I should put into that method 😄
19 replies
FFilament
Created by Samus_Aran on 5/25/2024 in #❓┊help
Refresh a modal after an extra footer action is performed?
Nevermind, I think I got the solution. I had to define all actions at once within extraModalFooterActions() and then for each action define the display behaviour as a closure. for example with my "check" action: ->visible(fn (Invoice $record) => $record->status === InvoiceStatus::Booked) This will cause the desired refresh behaviour of my modal footer.
2 replies
FFilament
Created by Samus_Aran on 5/15/2024 in #❓┊help
Filtering a Table Widget from a Chart Widget on a Resource View page possible?
Took some digging but instead of my dd above it's $this->tableFilters['segment_id']['value'] = $segmentId 😄
5 replies