SQLFORM.grid has ondelete, SQLFORM(...).accept(...) does not. The book
is correct.

The problem is that grid uses ondelete when doing ajax delete but not
when using SQLFORM(...).accept(...)

On Feb 10, 4:03 am, Manuele Pesenti <manuele.pese...@gmail.com> wrote:
> I post here this discussion because I'm not yet subscribed to the
> developers list and this regards the documentation...
>
> Il 09/02/2012 18:55, Massimo Di Pierro ha scritto:
>
> > this is a good point. The problem is how to fix it.
>
> > sqlhtml does not take a ondelete (perhaps it should, and grid should
> > pass it to it).
>
> in this case I think there's a bug or a not complete information in the
> book? Or maybe it's my misunderstanding..
>
> citing 
> fromhttp://web2py.com/books/default/chapter/29/7#SQLFORM.grid-and-SQLFORM...)
>
> The complete signature for the grid is the following:
>
> SQLFORM.grid(query,
>               ...
>               onvalidation=None,
>               oncreate=None,
>               onupdate=None,
>               ondelete=None,
>               ...
>
>
>
>
>
>
>
>
>
> > ad it is grid takes a ondelete(table,record) and not a ondelete() as
> > in the example in the issue. This is because it is used (or it is
> > supposed to be used) in the ajax delete callback and therefore there
> > is no form.
> > This means we cannot pass grid(...ondelete...) to
> > form.accept(...ondelete...) because the latter does not exist and the
> > format would be incompatible anyway.
>
> > proposal for a solution?

Reply via email to