Global search for simple resources?
Is there a way of including simple resources in the global search?
Possible a link to the list page with an extra parameter with the resource identifier and it automatically opens the modal.
11 Replies
There is not, as Livewire doesnt allow you to open modals when the page first loads unfortunately
we can try again in v3
There might be a way: https://stackoverflow.com/questions/63383112/open-modal-automatically-in-livewire-component-it-doesnt-work
Stack Overflow
open modal automatically in livewire component it doesn't work
I wanna show a modal when initializing the component, but it doesn't work. I'm using $this->emit('show) to open the modal
When I add a button in my view the emit('show') works!, but I don't want...
Like adding a view-component that does what is proposed in the SO-answer, which would then have to emit the show-action.
we use browser events to open modals.
So those modals are not triggerable somehow?
not on the page load, only after
there are hacky workarounds but i dont want to muddy the codebase with those at the moment
Understandable.
I worked around this by linking the search result to the resource with a filter applied to single it out. I can share the code if you want?
I’m not sure you’d want a modal opening directly from clicking on a result?
This method works well for me.
Cheers guys appreciate all your input 🙂 Hopefully Dan can work his magic in v3.
Yeah please that sounds like a good enough work around for now.
All on the resource ("companies" in my case):
Awesome cheers