JeffP
JeffP

Reputation: 555

web2py: How to target a div using the response.menu

The A() helper can take a cid or target attribute to target a DIV to load content. Using the response.menu tuples, how can this be achieved?

response.menu = [
    (T('Home'), False, URL('default', 'index'), []),
    (T('Library'), False, None, [ 
        (T('Services'), False, URL('default', 'library.load', args=['service'], user_signature=True))
        ])
]

edit:

My ultimate goal is to load the page in library.load into a target div.

Upvotes: 0

Views: 52

Answers (1)

JeffP
JeffP

Reputation: 555

I cheated with jQuery at index.html. I hope there is a way to inject the attribute at server level.

<script>
    var s = $(".dropdown-menu a:contains('Services')").attr( 'data-w2p_target','main_div_comp' );
    s.attr("data-w2p_method", "GET");
</script>

Upvotes: 0

Related Questions