I tried the first method (categories.load) and it works nice.
Just there are a couple of issues:
This line below when it rendered as ajax content: (inside categories.load)
<li<h3><a href="{{=URL('default', 'index',
args=(item.id))}}">{{=item.f_item_name}}</a></h3></li>
First, It doesn't generate the h3 style and the url adds 'load' to the url.
e.g /default/index.load/1
which for it self, renders all the index queries on a none template
included page.
?
thanks.
On Sunday, September 15, 2013 2:14:01 AM UTC+3, Avi A wrote:
>
> Thanks.
>
> On Sunday, September 15, 2013 1:31:17 AM UTC+3, Anthony wrote:
>>
>> If you put the following line in a view:
>>
>> {{extend 'layout.html' if not request.ajax else None}}
>>
>> that view will not compile if you elect to compile the application
>> (compiling is an option in the admin app). Compiling an app is optional,
>> but it does speed up execution. So, the above method will work, but that
>> view will not compile, so you won't benefit from the execution speed-up in
>> that case.
>>
>> Anthony
>>
>> On Saturday, September 14, 2013 6:25:12 PM UTC-4, Avi A wrote:
>>>
>>> Second option works, but what do you mean by "that particular view will
>>> not be compileable"?
>>>
>>> On Saturday, September 14, 2013 11:58:33 PM UTC+3, Avi A wrote:
>>>>
>>>>
>>>> Hi,
>>>> This is my link on the index page:
>>>> {{extend 'layout.html'}}
>>>> <div id="ajax_target">
>>>> .........
>>>> <a href="#" onclick="ajax('{{=URL('default', 'categories', args=(
>>>> category.id))}}', ['ajax_content'],
>>>> 'ajax_target')">{{=category.f_category_name}}</a>
>>>> ..........
>>>> </div>
>>>>
>>>> where ajax_content is a div I want to display from the categories page,
>>>> on the index page.
>>>> Categories page:
>>>> {{extend 'layout.html'}}
>>>> <div id="ajax_content">
>>>> ......
>>>> </div>
>>>>
>>>> It works as expected, except that it brings the whole categories page
>>>> (including the header and footer ), which is not expected.
>>>> what should I do?
>>>> Thanks.
>>>>
>>>
--
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/groups/opt_out.