| 77 | {{{ |
| 78 | instance = S3OptionsFilter(field, _class="class", _name="name", options=None, represent=None, widget=None) |
| 79 | }}} |
| 80 | |
| 81 | Parameters: |
| 82 | |
| 83 | - '''field''' is a field selector (or a list of field selectors) for the field(s) to filter by |
| 84 | |
| 85 | Options: |
| 86 | |
| 87 | - '''options''' is a dict {value:label} of options for the widget, or a callable that returns such a dict |
| 88 | - '''represent''' is a callable to render a label for each option |
| 89 | - '''widget''' selects the widget, either "checkboxes" (S3 grouped checkboxes, default) or "multiselect" (jQuery UI Multiselect-Dropdown by Eric Hynds) or "multiselect-bootstrap" (Bootstrap Multiselect-Dropdown) |
| 90 | - '''comment''' is a help text or tooltip widget to render with the filter widget |
| 91 | |
| 92 | HTML Attributes: |
| 93 | |
| 94 | - '''_class''' is the CSS class for the input field |
| 95 | - '''_size''' is the input field width in characters |
| 96 | - '''_name''' is a name for the input field |
| 97 | |
| 98 | Note: if no '''options''' are specified, the widget will determine the options from the field (=all unique values for this field currently available in the DB) |
| 99 | Note: if no '''represent''' is specified, the widget will use the labels specified in '''options''', or otherwise use the field representation function |
| 100 | Note: if the field is a foreign key, then '''represent''' can also be a string template for the referenced rows |