Open a specific Modal
I want to open the specific modal when redirect to other page
39 Replies
I liked that when redirecting to a page it opened right away in the specific site
I'm doing it this way
Is it possible to open the modal from here?
If it's only a modal, redirect with a route param
example.com/test?open=modal-id
And anywhere you want in JS, read the URL param to dispatch an open modal event from Liwewire, I don't remember the exact function but something like $dispach('open-modal', ['id' => "your modal id from url param"])
will try it out
Let me find the right function
dispathBrowserEvent if I'm not in error?
Laravel
Events | Laravel
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.
but isn't that just for the blade?
Yep, sorry, let me find the filament version
this is my code
for example, here I redirect to the page where the partners are located for the payment list, I just don't know how to open the specific modal that I want when I click to see the payment on the current page.
Currently writting a sample code for you 😉
thx
I was thinking of something like this but it doesn't work
Yeah, there are changes between v2/v3 of filament and livewire
I'm currently using v2 still
ohhh
didn't see the tag on your help post
I didn't put
?
for a moment I thought I had forgotten
I can't help you since I don't have any project in V2 BUT you have a good starting point here:
I'm not sure about the
return
I maybe forgot some parenthesis 😄
I'll try but where do I put the script part in the resource?
register it in a custom js file that you load using
Filament::registerScripts()
in your AppServiceProviderok, I never did that thanks, I never had the need either
Or override the
$view
of your Edit[...]
inside your App/Filament/Resources/YOUR_RESOURCE/Pages/Edit[YOUR RESOURCE]
ok, when i have some results i will post here
unsuccessfully
@Dan Harrin Do you have any tips, I've tried some things but without success, or is it possible?
@Duarte Barbosa please read the #✅┊rules and don't tag maintainers who are not part of the conversation
my bad
just waiting for someone to give a tip
hopping *
It looks like JibayMcs gave you a lot of helpful tips already. What's not working for you?
basically when i do the redirection to the page with the relation manager, i want to open it in the register in question, and i tried to do the JibayMcs tip but i didn't succeed, i don't know if i missed something?
I wish I could do something like this, but I still haven't figured out how to open the specific modal
This is more complicated in v2... In v3 it's easier to trigger table actions.
Do you really need the modal though? Can you instead redirect to a simple Edit page?
the problem is that this action is performed in relation manager.
in v3 I can do this more easily, I can even upgrade, over the weekend I will test it separately, and see how it goes
any v3 link that I can base myself on?
i dont know how v3 would be easier tbh
maybe patrick knows something i dont
all I know is that in Jibay's <script>, he writes PHP. so thats def not gonna work.
sorry bth i hadn't read all the rules sorry for the tag
I was hoping you knew something, my bad
why not just use a normal resource with a page instead of redirecting to a relation manager
as patrick said
I'm going to put this option on the table in the next daily, I hope they accept it xD
just a question, can i just make a normal edit page or do i have to make a cutom/resource ?
normal edit page
in a resource
ok thx hope they don't mind.
Thank you for your help.
Thank you for your help
I was referring to this from memory : https://github.com/filamentphp/filament/discussions/7007#discussioncomment-6459024
But the context here is different...
GitHub
call table action after the previous has run · filamentphp filament...
Hello! When a table action is run, is it possible to automatically call another one? Example: after the admin has assigned the element to himself (table action #1), open it for viewing (custom moda...
thats opening one modal after another has finished
on the same LW component
Yes, distorted memory 😄
thank you all, you already helped me a lot and removed my doubts, thank you very much
So I know it's been a long time since I posted, but I ended up finding a way that I already did about a month ago, but I just had time to stop by here now.
basically in relation manager as it is a simple resource, it uses mountTableAction to open the modal
so in the main resource I made a url like this
and in relation manager something like this
And that's all if I haven't forgotten anything, it's been a while since I did this, but I remembered that I had opened help here so I came to leave my results.
As I said, I forgot to specify something xD
in this part:
the 'pagamento' must be the same name given in the action
And now I think I haven't forgotten anything
I hope this helps xD