Changes between Version 11 and Version 12 of S3/S3GroupedOptionsWidget


Ignore:
Timestamp:
04/01/13 20:22:38 (9 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3GroupedOptionsWidget

    v11 v12  
    1717== Python Widget Class ==
    1818
    19 The {{{S3GroupedOptionsWidget}}} is implemented in {{{/modules/s3/s3widgets.py}}}.
     19The {{{S3GroupedOptionsWidget}}} is implemented in {{{/modules/s3/s3widgets.py}}}. It renders a normal SELECT element (with or without optgroups, depending on the size-parameter):
     20
     21{{{#!text/html
     22<select multiple="multiple">
     23<optgroup label="A - K">
     24<option value="Ainaro">Ainaro</option>
     25<option value="Dili">Dili</option>
     26<option value="Kuala Lumpur">Kuala Lumpur</option>
     27</optgroup>
     28<optgroup label="L - M">
     29<option value="Lautém">Lautém</option>
     30<option value="Manatuto">Manatuto</option>
     31<option value="Manufahi">Manufahi</option>
     32</optgroup>
     33<optgroup label="V - Z">
     34<option value="Viqueque">Viqueque</option>
     35</optgroup>
     36</select>
     37}}}
     38
     39...and then injects a !JavaScript to apply the jQueryUI {{{groupedopts()}}} widget.
     40
     41Options can also receive a "title" attribute which is used by {{{groupedopts()}}} to render a hover-tooltip for these options.
    2042
    2143'''The instance of this class receives the widget options''':
     
    3355  ||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||
    3456  ||multiple||boolean||multiple options can be selected (False will render radio-buttons instead of checkboxes)||True||
    35   ||size||integer||the maximum number of option in merged letter-groups (None to no group lexicographically)||12||
     57  ||size||integer||the maximum number of option in merged letter-groups (None to not group by first letter)||12||
    3658  ||cols||integer||the number of options per row||3||
    3759  ||help_field||string or dict {value: tooltip-string}||field in the referenced table (if field is a foreign key) to retrieve a tooltip text for each option (to be shown when hovering over the option label), or a dict of tooltips, or a callable returning such a dict||None||
    3860  ||none||boolean||Render "None" as regular option||False||
     61
     62  ''Note'': if there are fewer total options than ''size'', options will not be grouped by first letter at all.
    3963
    4064'''To render the HTML for the widget and inject the necessary !JavaScript, call the widget like''':