How do I execute Alpine code when clicking on a modal?

As the title says, I want to execute some custom alpine code, or at the very least some plain JS code in general. Is that possible, if so, how?
6 Replies
DrByte
DrByte12mo ago
Can you add x-init="foo" to your modal component, so "foo" can do its execution?
DarkKnight
DarkKnightOP12mo ago
How? In the blade file?
DrByte
DrByte12mo ago
Yes. I had to do that for a custom component I was making (a clone of an existing component with altered functionality), in order to fire JS from an external script. Not sure if any/many Filament components allow attaching x-init to them without overriding them.
DarkKnight
DarkKnightOP12mo ago
Maybe someone else knows?
krekas
krekas12mo ago
What do you want to do with js?
DarkKnight
DarkKnightOP12mo ago
I figured it out! I wanted to expand on an already existing plugin Add my own functions and such
Want results from more Discord servers?
Add your server