= S3GroupedOptionsWidget = [[TOC]] == Python Widget Class == The {{{S3GroupedOptionsWidget}}} is implemented in {{{/modules/s3/s3widgets.py}}}. '''The instance of this class receives the widget options''': {{{#!python from s3.s3widgets import S3GroupedOptionsWidget instance = S3GroupedOptionsWidget(options=None, multiple=True, size=None, cols=None, help_field=None, none=None) }}} '''Parameters''': ||'''Parameter'''||'''Type'''||'''Explanation'''||'''Default'''|| ||options||list of tuples [(value, label)], or as dict {value: label}||the options, None to auto-detect the options from the Field during rendering||None|| ||multiple||boolean||multiple options can be selected||True|| ||size||integer||the maximum number of option in merged letter-groups||12|| ||cols||integer||the number of options per row||3|| ||help_field||string or dict {value: tooltip-string}||field in the referenced table to retrieve a tooltip text for each option (for foreign keys only), or a dict of tooltips, or a callable returning such a dict||None|| ||none||boolean||Render "None" as regular option||False|| '''To render the HTML for the widget and inject the necessary !JavaScript, call the widget like''': {{{#!python widget = instance(field, value, **attributes) }}} '''Parameters''': ||'''Parameter'''||'''Type'''||'''Explanation'''||'''Default'''|| ||field||Field||the field to select options for ''(required)''||-|| ||value|| ||the current value(s) selected ''(required)''||-|| ||attributes|| ||HTML-attributes for the widget, e.g. "_class" or "_id"||-|| == JQuery UI Widget == The {{{S3GroupedOptionsWidget}}} uses the {{{groupedopts()}}} widget in {{{jquery.ui.groupedopts.js}}}. This jQueryUI-widget-factory based widget renders a normal SELECT element as one or multiple groups of checkboxes: ---- - [wiki:S3 S3 API Guide] - DeveloperGuidelines