You can modify web2py_ajax.html and replace
function web2py_trap_form(action,target)
{
jQuery('#'+target+' form').each(function(i)
{
var
form=jQuery(this);
if(!
form.hasClass('no_trap'))
form.submit(function(obj)
{
jQuery('.flash').hide().html('');
web2py_ajax_page('post',action,form.serialize(),target);
return
false;
});
});
}
with
function web2py_trap_form(action,target)
{
jQuery('#'+target+' form').each(function(i)
{
var
form=jQuery(this);
if(!
form.hasClass('no_trap'))
form.submit(function(obj)
{
jQuery('.flash').hide().html('');
web2py_ajax_page('post',action,form.serialize(),target);
return
false;
});
});
/* add this
*/
jQuery('#'+target+' a').each(function(i)
{
var
a=jQuery(this);
if(!
a.hasClass('no_trap'))
a.click(function(obj)
{
jQuery('.flash').hide().html('');
web2py_ajax_page('get',a.attr('href'),
[],target);
return
false;
});
});
}
On Aug 3, 9:34 am, "mr.freeze" <[email protected]> wrote:
> If I click a link in a component that has ajax=True, it takes me to a
> bare page with only the component. Can we add the option to trap links
> too?