Thanks Anthony
I'm out for the next 10 days but will get on this straight away when I
get back. Thanks again for all the help.
-Jim
On 7/15/2011 5:09 PM, Anthony wrote:
On Friday, July 15, 2011 5:42:43 PM UTC-4, Jim S wrote:
Ok, two last things stumping me now.
1. How do I reload my component using javascript
First, when you initially call LOAD() to create the component,
explicitly specify the 'target' argument, which will become the id of
the div that will contain the component content (otherwise, web2py
will create a random id). Then, at any time, on the client side you
can update the content of the component by calling
web2py_component(url, target), which is a Javascript function in
/static/js/web2py_ajax.js. The 'url' should be the URL of the
component action (it can even be a different component from the one
originally loaded into the div), and the 'target' should be the target
your originally specified when creating the component.
2. I have a CRUD form open in my iframe. When I click submit it
want it to submit and if it updates, close the iframe. If not,
redisplay with errors showing (it does this part already, just
don't want to lose it when I recode to close on update)
Does fancybox offer a way to close the iframe modal via Javascript? If
your iframe includes a component, you can have the component return
some Javascript via response.js. If it's just loading a regular page,
then I suppose the page could include some JS to be executed when it
loads.
Anthony