I use jQuery BlockUI (http://malsup.com/jquery/block/#overview) for this 
kind of thing. You can block the whole page or just a single page element, 
and you can even set it up so the blocking happens at the start of any Ajax 
request and stops when the Ajax request is complete.

Anthony

On Wednesday, March 28, 2012 11:22:25 AM UTC-4, weheh wrote:
>
> There are two cases where I would like to provide some eye candy in the 
> form of a spinning "wait" icon whilst web2py does some heavy processing. In 
> one case, I would like to do this while a form is being processed. For 
> instance, if someone wants to fill out a contact form, which sends an 
> email, it would be nice for the cursor to change to the wait cursor while 
> email does its thing. The other case is to start the wait cursor at the 
> beginning of an ajax call that I know will take awhile to execute. In both 
> cases, the cursor is to restore itself to its former state.
>
> In the ajax case, I've tried 'jQuery(document).css("cursor", "wait");' and 
> then changed wait to auto when all is done. That didn't work. I've also 
> tried doing it on just the wrapper div of the thing that initiates the 
> process. That didn't work either. 
>
> With regards to processing a form, I would need to be able to kick off a 
> jQuery(...).css(...) just before form.process().  I don't know how to do 
> that, assuming it's at all possible. I imagine rstoring the cursor would be 
> done by a similar mechanism just after the controller returns.
>

Reply via email to