On Sunday, February 25, 2018 at 7:57:22 PM UTC-5, 黄祥 wrote:
>
> @anthony, tested your code but the result is not expected, it's added 
> another a href
> *usually use in response.menu :*
> (T('Address'), False, URL('master', 'address'), [] ),
> *result:*
> <a class="dropdown-item" href="/test/master/address">Address</a>
>
> *change into :*
> (A('Address', _href='/test/master/address', _class='dropdown-item'), 
> False, *None*),
> *result:*
> *<a class="dropdown-item" href="None"></a>*<a class="dropdown-item" 
> href="/test/master/address">Address</a>
>
> *change into :*
> (A('Address', _href='/test/master/address', _class='dropdown-item'), 
> False, *''*),
> *result :*
> *<a class="dropdown-item" href></a>*<a class="dropdown-item" 
> href="/test/master/address">Address</a>
>

Which version of web2py? Can you show all of your code? Here is what I get:

>>> menu = [(A('mylink', _href='myurl'), False, None)]
>>> MENU(m).xml()
b'<ul class="web2py-menu web2py-menu-vertical"><li 
class="web2py-menu-first"><a href="myurl">mylink</a></li></ul>'

objective why i use a href in menu, because i want to use anchor accesskey 
> for keyboard shortcut menu and anchor title for description
> any idea?
>

Well, alternatively, you can also do:

menu = [(None, False, A('Address', _href='/test/master/address', _class=
'dropdown-item'))]

The third item can be any HTML helper object (the first item can only be a 
string or an A() helper).

Anthony

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

Reply via email to