^_^''' 

you can't create an attribute with a dash in python. if you want to use 
data, either use the ** notation (splatting a pre-built dictionary) or 
leverage the "special" data= argument that takes a dict (yep, you're not 
the only one using data- attributes...)


span_attrs = {'_data-placement' : 'top', '_data-toggle' : 'tooltip'}
SPAN('hello', **span_attrs)

OR

SPAN('hello', data=dict(placement='top', toggle='tooltip'))

On Wednesday, July 20, 2016 at 11:48:24 AM UTC+2, Annet wrote:
>
> I have the following menu:
>
> response.app_menu = [(CAT(SPAN('Connect', _class="btn btn-default", 
> _target="_blank")), False, URL())]
>
> I want to add a Bootstrap tooltip to the button, I tried:
>
> response.app_menu = [(CAT(SPAN('Connect', _class="btn btn-default", 
> _target="_blank", _data-placement="top",  _data-toggle="tooltip", 
> _title="Business base and nxt")), False, URL())]
>
>
> but this results in a 
>
> SyntaxError("keyword can't be an expression", ())
>
> Is there a way to add a tooltip to a menu item?
>
> KInd regards,
>
> Annet
>
>

-- 
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