Open modal from input field label
I wanted to open a modal from the checkbox label text, like Terms & Conditions.
The above code works but the link will come in the hint section. Also, it'll open another page and I want to show terms & conditions in the modal.
20 Replies
something like this?
Yes, but the will be in the Checkbox label how we'll use event in that label?
Hi,
$livewire->dispatchBrowserEvent('open-modal', ['id' => 'myModal']) i think
let me know if it works because I don't know 😅
This works for me but having some issues with it. giving undefined variable and doesn't exist error.
The main problem is that I'm having a livewire poll every 5sec and it's showing a modal every 5sec without clicking. With a click, no operations performing.
My main task is:
-> From the page click of a button show 1st modal with a form and it's having a terms checkbox.
-> After submitting form show 2nd and after that 3rd modal.
All modals have some links through the form checkbox, radio, etc., and all the links open another modal same as the terms modal.
With your solutions, I'm trying to find a solution to work it properly. 🙂
hum.. a complex form
ahh ok, I understood <a>Terms</a> as a label now
didn't work?
It's giving me an undefined variable error on my resource.
"The main problem is that I'm having a livewire poll every 5sec and it's showing a modal every 5sec without clicking. With a click, no operations performing." 🤔
Is it necessary?
Yes, Let me explain the full process.
are you using a resource, or custom page, custom livewire component (outside admin panel)... ?
A product is purchased by a person and after that between merchant-person one to one conversation (Chat only) will go on.
So, to show conversations I'm using a filament list resource. On this page, for the product, I've some other functionality which is in 2-3 steps to raising an issue, feedback, etc. and that will be done from the conversation list page through a modal.
RelationManager will be not useful for this just because full page is having a custom process and display.
you may divide the functionalities in livewire components, widgets, avoiding conflicts.. maybe
How can I call a livewire component from a filament resource through $emit?
https://laravel-livewire.com/docs/2.x/events#firing-events
I tried this process but not working
Livewire
Events | Livewire
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.
Call or activate? is the livewire in the same class?
Call, I'm dividing all modals into a single livewire component. And open up them one by one as per the requirment.
Ok... So just use actions or add the livewire call onto the extraAttributes
Thank you. But, I wanted to do like this: https://stackoverflow.com/a/60666517 and tried with multiple ways to do it but not working.
Stack Overflow
laravel livewire, how to pass the id or data to another component b...
I have two components Posts and Post, Posts show the posts and by clicking the image I want to show the data of clicked post in another component.
Posts class and component down below:
Component ...
That should work fine, or you can render the content at all times, but hide it and condition it to show based on a public property trigger
$wire.emit works only with a current component in my case. It's not working with a different component. I don't know why but in my case it's not working. 😂
Filament list resource is one type of livewire component and I want to emit another livewire component listener method on button click event.
Maybe $wire.emitTo or dispatch a browser event.