On Wednesday, July 31, 2019 at 5:13:31 AM UTC-7, Vlad wrote:
>
> It's not really about a menu as a whole (that would be easy). It's about 
> dynamically changing the background color for each menu item individually. 
> In this context I can't pass neither style nor class (in contrast with, for 
> example a list helper where elements/options are made up of another helper 
> and take class, style, and are fully configurable one at a time)... 
>
>
maybe try set_attribute(), if you have the item?

/dps
 

> On Wed, Jul 31, 2019, 2:48 AM Dave S <snide...@gmail.com <javascript:>> 
> wrote:
>
>>
>>
>> On Tuesday, July 30, 2019 at 3:09:24 PM UTC-7, Vlad wrote:
>>>
>>> what would be the best way to specify a background color (different for 
>>> each menu item, depending on some database-driven data) when I build the 
>>> menu with menu.append(...) in menu.py? 
>>>
>>> I would love to have something like this: 
>>>
>>> menu.append([description, False, 
>>> URL('catalog','regimen',args=[id]),[]],_style='background-color:red;')
>>>
>>> but of course, this doesn't work this way - 
>>>
>>>
>>>
>> I'd look at using _class instead of _style.  (_class defaults to 
>> 'web2py-menu web2py-menu-vertical')
>>
>> /dps
>>  
>>
>> -- 
>> 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 a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/AXPsP-HlSLk/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/dcaea736-c629-43c7-924a-b07764ce952a%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/web2py/dcaea736-c629-43c7-924a-b07764ce952a%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/a2563679-e8ca-476d-a058-e1d649dc1d12%40googlegroups.com.

Reply via email to