I found a solution. I bit "insane", but it works.
I post it here so that it can help others.
In the function responsible for the the grid's selectable button action I
redirect to itself with the grid selection as a request.var.
redirect(URL(vars={'id': ids[0]}, user_signature=True))
Then on the original page, I added this code at the bottom of the page.
{{if request.vars and request.vars.id:}}
<script><!--
window.onload = function ask_for_confirmation() {
var r = confirm("{{=T('Are you sure you want to delete this
object?')}}");
if (r == true) {
window.location.href = "{{=URL('open_wo',
'delete_after_confirmation_approval_not_required', args=[request.vars.id],
user_signature=True)}}";
}
}
//--></script>
{{pass}}
quarta-feira, 13 de Março de 2019 às 21:15:11 UTC, João Matos escreveu:
>
> Hello,
>
> How can I call the delete confirmation dialog from one of the grid's
> selectable buttons?
>
> Thanks,
>
> JM
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.