[web2py] Re: changing grid formname -- response.flash ?

2015-06-01 Thread LoveWeb2py
Thank you for the reply, Massimo! How can I make it say Record Added! when the SQLFORM.grid is processed? I know how to do it for SQLFORM, but not sure how to do it for the grid? On Monday, June 1, 2015 at 4:04:22 PM UTC-4, Massimo Di Pierro wrote: This should not be the case. they logic is

[web2py] Re: changing grid formname -- response.flash ?

2015-06-01 Thread Massimo Di Pierro
This should not be the case. they logic is unrelated. Something else is going on. On Monday, 1 June 2015 14:21:50 UTC-5, LoveWeb2py wrote: Hello, Lets say I have grid=SQLFORM.smartgrid(db.table, formname=mytablename) return dict(grid=grid) When I change the form name do I lose the

[web2py] Re: changing grid formname -- response.flash ?

2015-06-01 Thread Massimo Di Pierro
if grid.create_form and grid.create_form.accepted: response.flash = 'record created' elif grid.update_form and grid.update_form.accepted: response.flash = 'record updated' this should really go in the book On Monday, 1 June 2015 15:11:28 UTC-5, LoveWeb2py wrote: Thank you for the

[web2py] Re: changing grid formname -- response.flash ?

2015-06-01 Thread Anthony
Haven't tried it, but something like this might also work: grid = SQLFORM.grid(..., oncreate=lambda f: response.update(flash='Record Added!'), ...) There's also an onupdate argument. Anthony On Monday, June 1, 2015 at 6:11:04 PM UTC-4, Massimo Di Pierro wrote: if grid.create_form and