Hi,
Using web2py 2.14.6.
In my controller function I have something like the following:
def onupdate(form):
log.info("updated %s", str(form.vars['id']))
def ondelete(tbl, id_):
log.info("About to delete %s", str(id_))
return dict(grid = SQLFORM.grid(db.mytable, create=True, editable=True,
deletable=True,
ondelete=ondelete, onupdate=onupdate))
(That is paraphrased, so there may be minor errors)
This gives me a grid view with edit and delete buttons. If I click the
delete button, ondelete fires as expected.
If I click the edit button and then on the subsequent "edit" page, check
the 'Check to delete' tick box and then submit, my record is deleted as
expected, but it's onupdate that gets fired.
Questions:
Is this the expected behaviour ?
How would I remove the 'Check to delete' tick box from the edit record page
but retain the delete buttons on the grid view ?
Alternately, what's the accepted idiom for checking if the update is
actually a delete in the 'onupdate' call back ?
Thanks,
Robin
--
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.