SQLFORM.grid in LOADed component Delete behavior

82 views
Skip to first unread message

Jim S

unread,
Mar 13, 2013, 2:18:25 PM3/13/13
to web...@googlegroups.com
Hi

I have a LOADed component that has a SQLFORM.grid in it.  The definition looks like this:

grid = SQLFORM.grid(updateQuery, fields=[db.tankSite.name], left=left,
create=False, editable=False, details=False,
maxtextlength=45, orderby=[db.tankSite.name],
csv=False, searchable=False, showbuttontext=False,
formname='tankSiteList')

You can see I'm only showing a Delete button in addition to my fields.  When I click on the delete button the popup message displays and clicking Ok deletes the record.  This is all done via ajax with no page transitions/reloads.  What I want to have happen is to force the component to reload after the record is deleted from the SQLFORM.grid.  Is there any way for me to force this to happen?

I also have a SQLFORM.factory for in this same component and if I delete a record, then next attempt to process my SQLFORM.factory form fails.  Subsequent attempts work, but the first attempt after a delete fails until the component is reloaded.

I'm happy to provide more information on the whats and whys if you want more.  

Thanks for taking a look.

-Jim

Niphlod

unread,
Mar 13, 2013, 7:15:24 PM3/13/13
to web...@googlegroups.com
 I'd say that if you want a full reload after deleting the record you should disable the default delete and code your own (with redirect) using the links argument or intercepting earlier a request.args containing 'delete' . As for the sqlform in the other component, try to decouple and see what the submit button is doing....

Jim Steil

unread,
Mar 13, 2013, 8:15:14 PM3/13/13
to web...@googlegroups.com
That's what I was hoping to avoid, but probably the only way it is going to work.  Thanks for taking a look.

-Jim



--
 
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/tlvsgoPU3o8/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages