Custom form component. But i want it to show a model.
I have a custom component. I want to show a button on my form. A button that shows a modal. I couldnt find anything related to this so i thought i could ask for some help or advice.
Solution:Jump to solution
yes.. create a livewire component called
CreateDealer
```html
<!-- resources/views/livewire/create-dealer.blade.php -->
<div>...17 Replies
ReportsNewDealer is the custom component. Code on the right side
Can this help?
https://github.com/filamentphp/filament/discussions/3419
GitHub
How to use · filamentphp filament · Discussion #3419
Hi i have a complex, custom form page where on a click of a button i want to open a modal with some extra data. Can x-filament::modal be used for this? It's not an action so i need to be opened...
Filament
Opening a modal in a blade with button outside it's trigger slot by...
Filament is a collection of tools for rapidly building beautiful TALL stack apps, designed for humans.
Also this
You need to dispatch this
open-modal
eventThank you i will try it out and let you know
It wont work so i tried using a livewire component but that also doesnt work
Here i call the custom filament component
--------------------------------------------
this is the component that shows the view
--------------------------------------------
this is the content of the view
--------------------------------------------
this is the livewire component
-------------------------------
this is the view of the livewire component
-------------------------------------------
is it not possible to use a livewire component or am i doing something wrong
please read #✅┊rules and share your code correctly..
i changed the code format.
try to add an id
and dispatch the event
@Leandro Ferreira the livewire component wont show up in my form. i cant test if the modal works. Do you maybe know what the problem could be
does anyone know what i should do im stuck with this problem
Can you simplify your Livewire component and get it to render? Remove the modal code and show a simple message. I think this is your first step...
Second, I think your modal should live outside of your form component. Outside of the entire form ideally.
Solution
yes.. create a livewire component called
CreateDealer
Use View
to render the component
@gestolen , if you don't need a livewire component, just use a custom view to render the modal.
You can also use
$getRecord()
inside the custom view or livewire component@Leandro Ferreira , I want to create a static Button which will ideally open up a Modal window conditionally. I couldn't find any suitable component in Livewire.
So anyone can suggest a way ?
lets chat in your question...
Sure thing
I tried this at the beginnning and after you told me i did it again and it just wont show up. Im gonna trry @Leandro Ferreira 's answer by using the view component in my form.
@Leandro Ferreira creating the view component en including my livewire view seems to be working right. Hope i can get the form working. Thank you all
@Leandro Ferreira Hi, i still have one little problem.
When i try to use a var in my view using livewire i cant get the value out of it. It gives me a undefined error.