How to customize edit to pass parameter to your code and in delete button if you want to use sweet alert? #576
Unanswered
anonymouse703
asked this question in
Q&A
Replies: 1 comment 5 replies
-
Hello!. It is not good practice to add too many responsibilities to a component. As a suggestion, I would do the following:
I'll convert it into discussions so we can follow along. Let me know if it worked!. Thanks |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Feature Request
Can customize button on edit and delete so that I can pass parameter in my code and can use sweet alert on delete
Summary
To be able to pass parameter in edit function and use alert warning before delete to avoid accidental mis-click
Why is this needed?
This is to prevent automatic delete of a record if a user accidentally click the delete button
Suggested Solution(s)
Add SWAL on delete
Other problem
I have this problem since the default in the button is route but in my web.php it's different since I only get the component class to display and let wire:click and render do the display and if I do
php artisan route:list
the the name of the route is not display and also I usually used wire:click in most of the button in edit and deletethis is my route
In the default button of power grid is something like this
but in my recent project I used bootstrap dataTable and I did like this
<button wire:click="editClientContact({{ $data->id }})" class="btn btn-info delete-header m-1 btn-sm" title="Edit"><i class="fa fa-pencil" aria-hidden="true"></i></button>
The scenario is I used modal in my forms so if I click edit I want to pass the id in wire:click to trigger my code same as in delete button to avoid accidental click of the user
Beta Was this translation helpful? Give feedback.
All reactions