hugh_jazz99
hugh_jazz99
FFilament
Created by hugh_jazz99 on 7/24/2023 in #❓┊help
How can I render form builder components in a custom view?
Hi guys, is there documentation on how to use the form builder on a custom view? I have my form schema defined, what's the convention to render the fields on my custom view page? My resource defines a custom page:
public static function getPages(): array
{
return [
...
'view' => Pages\EventCheckin::route('/{record}'),
];
}
public static function getPages(): array
{
return [
...
'view' => Pages\EventCheckin::route('/{record}'),
];
}
I defined a custom view on this page, so I can use a 3rd party datatable library on it:
protected static string $view = 'filament.resources.event-resource.pages.event-checkin';
protected static string $view = 'filament.resources.event-resource.pages.event-checkin';
I also defined a form schema:
protected function getFormSchema(): array
{
return [
TextInput::make('name_search')->required(),
... other fields
];
}
protected function getFormSchema(): array
{
return [
TextInput::make('name_search')->required(),
... other fields
];
}
My question is, how can I render those form fields on my custom view page? I couldn't find what convention (eg <x-filament-.... />) to use on the docs
7 replies
FFilament
Created by hugh_jazz99 on 7/19/2023 in #❓┊help
JS notifications aren't sent if there's no server connectivity. Is there a way around this?
I get this on the console: POST https://site.test/livewire/message/filament.core.notifications net::ERR_INTERNET_DISCONNECTED I trigger the notification from javascript, like so:
.catch((error) => {
new Notification()
.danger()
.title("Error sending request")
.body(error)
.send()
});
.catch((error) => {
new Notification()
.danger()
.title("Error sending request")
.body(error)
.send()
});
I wasn't expecting Filament to need the server to show a client-side notification, I just wanna let the user know that the request failed. If client-side notifications need the server, how should I handle this?
4 replies
FFilament
Created by hugh_jazz99 on 6/1/2023 in #❓┊help
Is it possible to have a table action call a JS/Alpine method instead of a Livewire method?
I'd like to have an action be processed on the client-side, rather than with Livewire, which would be server-side. Is it possible to make an action call a JS/Alpine method? Emitting an event would also work. Also, can actions such as sorting and filtering be done client-side? For the actions, it seems like I use custom columns to do it, but I'd like to hear other ideas. My use case: I have a JS queue stored on local-storage. Whenever an action is called, it should be added to this queue (the action is just a request), and processed in order. This is to remediate unreliable internet, I want users to still be able to use the table and perform actions when the network goes offline, the queue attempts to process actions and retries them when the network is back online.
15 replies