Changes between Version 61 and Version 62 of S3/FilterForms
- Timestamp:
- 06/01/17 08:33:35 (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
S3/FilterForms
v61 v62 296 296 297 297 1. Ensure that Filter options update when entries are added/modified: 298 {{{ 298 299 {{{#!python 299 300 filter_form = S3FilterForm(... 300 301 _id = "%s-filter-form" % list_id, … … 302 303 }}} 303 304 304 2. Ensure that when individual datalist entries are ajax reloaded they are not filtered out due to not having the correct list_id: 305 {{{ 305 2. Specify the ''list_id'' for the data list and add it to the ''target'' of the filter form: 306 307 {{{#!python 308 list_id = "my-datalist" 309 310 datalist, numrows, ids = resource.datalist(..., 311 list_id = list_id, 312 ... 313 ) 314 output["filter_form"] = filter_form.html(..., 315 target = list_id, 316 ... 317 ) 318 }}} 319 320 3. Make sure the datalist retains its HTML-id during ajax-refreshes (so that the filter form can still find it), by adding the ''list_id'' parameter to the {{{ajaxurl}}} too: 321 322 {{{#!python 306 323 ajax_vars = {"list_id": list_id, 307 } 308 data = datalist.html(ajaxurl = URL(c=module, f=resource, args="datalist", 309 vars=ajax_vars, extension="dl"), 324 } 325 data = datalist.html(ajaxurl = URL(c = module, 326 f = resource, 327 args = "datalist", 328 vars = ajax_vars, 329 extension = "dl", 330 ), 310 331 ) 311 332 }}}