[web2py] Re: SQLFORM.grid and custom edit form

2014-12-13 Thread Ian Holser
I know this was a while ago, but I had a similar question and came across this thread. You can turn off the built in edit button by choosing editable=False, then create you own using links def example(): query = db.sometable links = [lambda row: A('Edit',_class='button btn btn-default',_hr

[web2py] Re: SQLFORM.grid and custom edit form

2014-04-14 Thread Tim Price
And what about if I do want to create my own edit form from scratch? How do I get the 'edit' button on the SQLFORM.grid to link to my custom form? On Friday, February 21, 2014 2:32:25 PM UTC+1, Anthony wrote: > > You can also customize the edit form created by the grid in the usual ways > (witho

[web2py] Re: SQLFORM.grid and custom edit form

2014-02-21 Thread Anthony
Depends on exactly what you want to customize. First, the grid itself takes an "onupdate" argument that it passes to form.accepts, and it takes an "editargs" argument, which is a dict of arguments to pass to the edit form. Aside from that, in your controller, you can do: grid = SQLFORM.grid(db.

[web2py] Re: SQLFORM.grid and custom edit form

2014-02-21 Thread Luca Guerrieri
mmmh... sorry Anthony but you know i'm new on web2py... can you show me more in deep this your last? thank you lucs -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Repo

[web2py] Re: SQLFORM.grid and custom edit form

2014-02-21 Thread Luca Guerrieri
mmmh... sorry Anthony but you know i'm new on web2py... can you show me more in deep this your last? thank you lucs -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Repo

[web2py] Re: SQLFORM.grid and custom edit form

2014-02-21 Thread Luca Guerrieri
mmmh... sorry Anthony but you know i'm new on web2py... can you show me more in deep this your last? thank you lucs -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Repo

[web2py] Re: SQLFORM.grid and custom edit form

2014-02-21 Thread Anthony
You can also customize the edit form created by the grid in the usual ways (without creating your own form from scratch), including having custom view code or specifying an alternative view altogether. Anthony On Friday, February 21, 2014 7:57:42 AM UTC-5, Luca Guerrieri wrote: > > Looks like i

[web2py] Re: SQLFORM.grid and custom edit form

2014-02-21 Thread Luca Guerrieri
Looks like it's my tie to post an answer :-)) To customize the edit form or new form in a SQLFORM.grid i put in the controller, but exactly before the sqlform.grid creation and with a return ... if request.args(0) in ['edit']: response.flash=T("Edit form") response.view = 'default/editclist.ht