Changes between Version 40 and Version 41 of S3/FilterForms
- Timestamp:
- 04/02/13 09:37:01 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
S3/FilterForms
v40 v41 30 30 For the configuration, a widget instance is created like: 31 31 32 {{{ 32 {{{#!python 33 33 instance = S3FilterWidget(field=None, **attr) 34 34 }}} … … 39 39 The widget is then rendered by calling it: 40 40 41 {{{ 41 {{{#!python 42 42 widget = instance(resource, get_vars=None, alias=None) 43 43 }}} … … 56 56 Configuration: 57 57 58 {{{ 58 {{{#!python 59 59 instance = S3TextFilter(field, _class="class", _size=40, _name="name", comment=None) 60 60 }}} … … 85 85 Configuration: 86 86 87 {{{ 87 {{{#!python 88 88 instance = S3OptionsFilter(field, _class="class", _name="name", options=None, represent=None, widget=None, comment=None) 89 89 }}} … … 116 116 Configuration: 117 117 118 {{{ 118 {{{#!python 119 119 instance = S3DateFilter(field, _class="class", hide_time=False, comment=None) 120 120 }}} … … 143 143 The filter form can be suppressed by a keyword argument to {{{s3_rest_controller()}}}: 144 144 145 {{{ 145 {{{#!python 146 146 output = s3_rest_controller(prefix, resourcename, 147 147 hide_filter=True # hide filter form in list views … … 158 158 For pages with filter forms, the filter widgets are configured per resource as a list of filter widget instances in the "filter_widgets"-setting like: 159 159 160 {{{ 160 {{{#!python 161 161 s3db.configure(tablename, 162 162 filter_widgets=[ … … 181 181 Additionally, there are a number of controller options for the s3_rest_controller call: 182 182 183 {{{ 183 {{{#!python 184 184 output = s3_rest_controller(prefix, resourcename, 185 185 filter_submit_url = submit_url, … … 190 190 }}} 191 191 192 ||'''Option'''||'''Type'''||'''Function'''||'''Default'''|| 193 ||filter_submit_url||URL string||where to request filtered data from||URL of the current call|| 194 ||filter_ajax_url||URL string||where to request updated filter options from||URL of the current call with /filter method|| 195 ||filter_formstyle||Formstyle function||Alternative formstyle for the filter form||built-in formstyle|| 196 ||filter_submit||String||Label for the submit button or tupel of (label, class) to also specify a CSS class for the button||T("Search")|| 192 '''Options''': 193 194 ||'''Option'''||'''Type'''||'''Function'''||'''Default'''|| 195 ||filter_submit_url||URL string||where to request filtered data from||URL of the current call|| 196 ||filter_ajax_url||URL string||where to request updated filter options from||URL of the current call with /filter method|| 197 ||filter_formstyle||Formstyle function||Alternative formstyle for the filter form||built-in formstyle|| 198 ||filter_submit||String||Label for the submit button or tupel of (label, class) to also specify a CSS class for the button||T("Search")|| 199 197 200 == Development == 198 201