Changes between Version 12 and Version 13 of S3/FilterForms


Ignore:
Timestamp:
03/27/13 09:49:45 (12 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/FilterForms

    v12 v13  
    2828== Filter Forms ==
    2929
    30   * ''tbw''
     30=== Configuration of Filter Forms in S3CRUD ===
    3131
     32S3CRUD has filter forms integrated in the /datatable and /datalist pages.
     33
     34For these pages, the filter widgets are configured per resource with the "filter_widgets"-setting like:
     35
     36{{{
     37s3db.configure(tablename,
     38               filter_widgets=[
     39                 S3TextFilter(["name", "email", "comments"],
     40                              label=T("Search"),
     41                              comment=T("Search for office by text.")),
     42                 S3OptionsFilter("organisation_id",
     43                                 label=messages.ORGANISATION,
     44                                 comment=T("Search for office by organization."),
     45                                 represent="%(name)s",
     46                                 widget="multiselect"),
     47                 S3OptionsFilter("location_id$L1",
     48                                 location_level="L1",
     49                                 widget="multiselect")
     50               ])
     51}}}
     52
     53The widgets appear in the form in list order.
     54
     55Additionally, there are a number of controller options for the s3_rest_controller call:
     56
     57{{{
     58output = s3_rest_controller(prefix, resourcename,
     59                            filter_submit_url = submit_url,
     60                            filter_ajax_url = ajax_url,
     61                            filter_formstyle = formstyle,
     62                            filter_submit = submit
     63                           )
     64}}}
     65
     66||'''Option'''||'''Type'''||'''Function'''||'''Default'''||
     67||filter_submit_url||URL string||where to request filtered data from||URL of the current call||
     68||filter_ajax_url||URL string||where to request updated filter options from||URL of the current call with /filter method||
     69||filter_formstyle||Formstyle function||Alternative formstyle for the filter form||built-in formstyle||
     70||filter_submit||String||Label for the submit button or tupel of (label, class) to also specify a CSS class for the button||T("Search")||
    3271== Development ==
    3372