On Aug 19, 2006, at 5:04 AM, OriginalBrownster wrote:
> It is possible to customize the colors and layout of turbogears  
> default
> widgets.
> I am specifially interested in a checkboxlist widget.

Widget's provide default CSS classes you can refer to in your  
stylesheet. For example, the CheckBoxList's class is "checkboxlist".  
This means you can refer to it in your stylesheet like:

ul.checkboxlist {background:yellow;}
and it's child elements like:
ul.checkboxlist li, ul.checkboxlist label, etc...

If you need to refer to some specific type of ChecboxList you can  
change it's class with the "field_css" parameter like:

CheckBoxList(options=["a","b","c"], field_class="mycbox")

You can also specify extra classes with the "css_classes" parameter:

CheckBoxList(options=["a","b","c"], css_classes=["mycbox"])

Which will append "mycbox" to the default class the widget provides.  
What you can accomplish with this is limited only by CSS's  
expressiveness.

If you need further customizations you will need to provide a custom  
template. You can do this when subclassing or when initializing the  
widget:

class MyCBoxList(CheckBoxList):
        template = XXX
or
CheckBoxList(template=XXX)

HTH,
Alberto


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to