On Friday, November 3, 2017 at 2:47:05 PM UTC-7, Jaison Raj wrote:
>
> Hi Vineet,
>
> Could you share your successful implementation of the code?
>

I'm not sure Vineet is still around.
 

> [ code elided] 
>
so basically i have a text box where user enters some text, then the 
> controller simply takes the text and runs a wait function before returing 
> the text to view.
>
I am trying to implement the said loading.gif during the function wait is 
> on-going.
> Could you please advice?
> I have very limited knowledge on Ajax.
>
>
Web2py has a very handy wrapper for ajax, the LOAD() helper.
<URL:http://web2py.com/books/default/chapter/29/12/components-and-plugins#LOAD>
The content argument allows you to customize the loading message (by 
default, just "Loading ...").

My example:

{{loadmsg = CAT("loading ...", BR(), SPAN(_class="fa fa-spinner fa-spin"))}}
{{=LOAD(c='myhosts', f='myhosts2.load', target='my_hosts', content=loadmsg, 
ajax=True)}}

(fa-spinner is an animation available from Font-Awesome-4.3.0 on the web)
When you need to move to fancier stuff, you can also use the jquery and 
ajax tools described in
<URL:http://web2py.com/books/default/chapter/29/11/jquery-and-ajax>

Hope this helps.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to