I have a list generated with the Bootstrap Table Generator of records. What I would like to do is to delete the record right from the list. Is this possible or do I have to use a data detail region?
can’t you just grab the record id and then onclick run a seperate server connect for the delete?
do you need to confirm before deletion? Open a model or something to confirm? Or just delete when you click on it?
But doesn’t the record ID need to. be in a form field?
I usually open a modal to confirm, but in this case the list is already in an OffCanvas Panel.
no set your server connect to a $_Get variable
and then pass the value when you send it.
You can do it with a flow and a bootbox as the confirm, will outline tomorrow (late here) if interested
Instead of a simple button on that cell, include the circle delete button of each cell in a serverconnectform with a hidden id and submit
Is it a table, or a form repeat?
A table
This is easy peazy, I do this all the time. usually what I do is create a variable to keep track of which ID it is. then onclick update the variable to what the id is. And then open the model or however you are confirming and send the id to server connect.
But if you don’t need to confirm you can use the actual ID to pass to server connect.
Thanks guys, I think I am going to go the confirmation modal path that I usually use. The Download and Delete buttons are pretty close on the list. I can see accidents happening.
so assign a variable: VarRememberID
on the onclick event assign ID to the variable and also open the modal.
Then on the modal assign the “save” or confirm button to send the server connect and pass the variable as the filter.
the save button should be regular button and not a submit.
A lot of times I will actually show the variable in the modal and test that a couple times to make sure I am getting the right value into the variable.
And also what seems confusing is that when you add the serverconnect to the page. Don’t assign any value to the get field. That gets assigned when you run it from the modal.
I will do a video on how to do this via a flow and using a bootbox dialogue,it is so much easier.
Looking forward to your video @Hyperbytes. Just trying to help with how I do it. Its always at the end of the day US, when I start having problems, and anyone that can help me is already asleep or it’s really late EU time. LOL.
That would be great @Hyperbytes! Thank you!
Same as @baub here using $_GET but waiting that video @Hyperbytes
Also you can use a hidden input on the modal and then, on click: set value = id
and open modal
then:
- If you use a server connect you can set the $_GET value from there.
- If you use a form on the modal, using that hidden input as a $_POST.
I definitely love how many ways there are for some functions
Something like:
And here what @famousmag says