If you specify the name of the target div for the component (e.g., LOAD(...,
target='expose')), the JS would be something like this:
jQuery('#expose a').click(function(e) {
e.preventDefault();
$.web2py.component(this.href, 'expose');
});
Anthony
On Friday, February 13, 2015 at 2:25:49 AM UTC-5, CrC Nommack wrote:
>
> Anthony thank you very much for your answer.
> As Leonel's answer partially worked I will try it first before going with
> yours.
> Anyway thank you very much.
>
> Kind regards
>
> El jueves, 12 de febrero de 2015, 17:41:00 (UTC+1), Anthony escribió:
>>
>> For now you'll probably have to write some custom JS to catch link clicks
>> and load the URL into the component div via Ajax. We could probably add an
>> Ajax trap option to Expose to handle this automatically. Feel free to
>> submit a github issue with this feature request.
>>
>> Anthony
>>
>> On Thursday, February 12, 2015 at 10:52:54 AM UTC-5, CrC Nommack wrote:
>>>
>>> Hi guys, I have a problem that I don't really know how to deal with.
>>> I will explain the context:
>>> I have an *index.html* that calls two components (LOAD)
>>> One of the components is a controller with an index function and within
>>> this function I put the following code:
>>>
>>> def index():
>>> path = os.path.join(request.folder, 'static', 'folder_files')
>>> related_media = Expose(path, basename='folder_files')
>>>
>>> return dict(related_media=related_media)
>>>
>>>
>>> The view is trivial:
>>>
>>>
>>> {{=related_media}}
>>>
>>>
>>> The problem is that when I click for example in a folder the result is not
>>> loaded in the component.
>>>
>>>
>>> Is it possible to make it work only inside the component?
>>>
>>>
>>> Thank you very much for your help.
>>>
>>> Kind regards
>>>
>>>
--
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.