Replies: 5 comments 4 replies
-
Same here. It doesn't really tell how it needs to be implimeneted. |
Beta Was this translation helpful? Give feedback.
-
What're you using to display modals elsewhere in your site? That'll help steer you in the right direction. At a basic level you can use the custom view to store your modal code, and call a function using wire click to populate and show it. At slightly more advanced, you could emit a call to a dedicated Livewire modal component that then displays for you, and emits a refreshDatatable when it's done. |
Beta Was this translation helpful? Give feedback.
-
The part I do not know how to do, is how do I, given the example of bulkActions functionality, open a modal when clicking on a The example is like this: public array $bulkActions = [
'openModal' => 'Install Something'
];
public function openModal()
{
//But here, can I ... invoke livewire components?? Something like:
return ['livewire.modal', ['someVariable' => 1]];
} Is it not clear to me how to do this with bulkActions, if someone can advise that would be helpful. Sorry I am new to this package and new to livewire.
The part I do not understand, is how to add a Thanks! |
Beta Was this translation helpful? Give feedback.
-
I use the "wire-elements/modal" component, a very convenient thing |
Beta Was this translation helpful? Give feedback.
-
Firstly, you're going to need to include a view using the customView function. This can contain the reference to your Livewire modal component, or just be a blade based component, up to you. Then in the relevant function for the bulkActions, you're going to want to set the variables etc to open & populate your modal. If you're using wire-elements/modal, then emit the function appropriately. To use your example:
Then your genericModal blade may have something like this:
or something like this:
For wire-elements/modal:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I need to understand how to use a modal with the tables, display it through an action button. Is there someone who can help me please.
Within the documentation I can't find any detailed explanation of this topic.
It only talks about this function but it is not enough for me.
public function customView(): string
{
return 'includes.custom';
}
help please i will be grateful
Beta Was this translation helpful? Give feedback.
All reactions