Dear SK,

That is a possible solution, but I feel that it is not *the most elegant 
way* to do it, since it involves creating more files leading to redundancy 
– and difficult to maintain as files number increases.

My intended approach overcomes that with half the number of View files 
using just one check for Ajax or not.

 

*The only problem with my program is that: it loads the footers twice – and 
I do not know Why! I think it has something to do with either the very 
rendering of Layout.html by w2p, or perhaps with my own JS Ajax call 
function.*

*I do not know why it loads the footers+scripts which come after the 
{{include}} twice.*

 

Also, running it on Safari from direct URL makes a non-Ajax call first, 
followed immediately with an Ajax call. That is not happening on Chrome or 
Firefox. Funny!

*— PRACHI V —*





On Friday, 10 July 2015 04:49:38 UTC-4, xmarx wrote:
>
> you can write two view.
>
> 1. view.html - direct request, extends layout.html
> 2. view.load - load via ajax. only requested information, not extends 
> layout or footer etc. 
>
>
> for example:
>
> view.load
>
> {{for i in range(0,9):}}
> {{=i}}
> {{pass}}
>
>
>
> view.html
>
> {{extend 'Layout.html'}}
>  # other things
> {{=LOAD('default','view.load',ajax=True)}}
>
>
>
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to