Changes between Version 61 and Version 62 of S3/FilterForms


Ignore:
Timestamp:
06/01/17 08:33:35 (8 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/FilterForms

    v61 v62  
    296296
    2972971. Ensure that Filter options update when entries are added/modified:
    298 {{{
     298
     299{{{#!python
    299300filter_form = S3FilterForm(...
    300301                           _id = "%s-filter-form" % list_id,
     
    302303}}}
    303304
    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 {{{
     3052. Specify the ''list_id'' for the data list and add it to the ''target'' of the filter form:
     306
     307{{{#!python
     308list_id = "my-datalist"
     309
     310datalist, numrows, ids = resource.datalist(...,
     311                                           list_id = list_id,
     312                                           ...
     313                                           )
     314output["filter_form"] = filter_form.html(...,
     315                                         target = list_id,
     316                                         ...
     317                                         )
     318}}}
     319
     3203. 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
    306323ajax_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             }
     325data = datalist.html(ajaxurl = URL(c = module,
     326                                   f = resource,
     327                                   args = "datalist",
     328                                   vars = ajax_vars,
     329                                   extension = "dl",
     330                                   ),
    310331                     )
    311332}}}