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
DrByte6mo ago
Can you add x-init="foo" to your modal component, so "foo" can do its execution?
DarkKnight
DarkKnight6mo ago
How? In the blade file?
DrByte
DrByte6mo 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
DarkKnight6mo ago
Maybe someone else knows?
krekas
krekas6mo ago
What do you want to do with js?
DarkKnight
DarkKnight6mo ago
I figured it out! I wanted to expand on an already existing plugin Add my own functions and such