wireui icon indicating copy to clipboard operation
wireui copied to clipboard

How pass parameters to modal?

Open LeoMachado94 opened this issue 2 years ago • 5 comments

I need pass parameters to modal, and I tried many ways to this, but without success.

LeoMachado94 avatar Jan 19 '24 20:01 LeoMachado94

Prease verify if the documentation if it is relative for your version. The default instalation, installs the V1, and documentation is default for v2. Additionally, you must fill in the information in order to assist you in what you are actually trying to do, for example, what are these parameters?

dfikeda avatar Jan 20 '24 19:01 dfikeda

Right, I installed it as the v2 documentation asks, and in my composer I have "wireui/wireui": "^1.18". @dfikeda The documentation says that we can invoke $openModal('modal-name'). In this scenario, I have a modal that is used to exclude users, and I would like to use the same modal just informing the user's ID. I wouldn't like to have 10 exclusion modes for a list of 10 users, I understand that there would be too many unnecessary components. I would like to do something like $openModal('delete-users', $userId).

LeoMachado94 avatar Jan 21 '24 00:01 LeoMachado94

At the moment I am using it as shown in the image below, but I understand that it would be much better to have 1 deletion modal component that would be reused for any user that needs to be removed, and not 10 components (1 for each user). Screenshot 2024-01-20 at 21 45 16

LeoMachado94 avatar Jan 21 '24 00:01 LeoMachado94

You can use this package to dinamic modal: https://github.com/wire-elements/modal

dfikeda avatar Jan 21 '24 01:01 dfikeda

I thought about using it, I already use it in other projects. But ideally, wireui would do this too. Do you see any performance problems using it as shown in the image?

LeoMachado94 avatar Jan 21 '24 01:01 LeoMachado94

Thank you for using WireUi!

We released stable version 2, with new features and improvements. Check if the mentioned problem has been resolved, if not, reopen this issue and we will provide more information. Thank you in advance, we are organizing Issues for better maintenance.

joaopalopes24 avatar Jun 13 '24 22:06 joaopalopes24