Changes between Version 4 and Version 5 of S3/S3SQLForm


Ignore:
Timestamp:
09/03/12 11:41:28 (9 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3SQLForm

    v4 v5  
    107107The first argument of S3SQLInlineComponent is the resource alias name (usually the tablename without module prefix).
    108108
    109 Where multiple sub-forms for the same component (e.g. with different filters) shall be embedded, they must each have a distinct "name" argument. (Filtering is not implemented yet - but will come soon). Otherwise this argument is optional.
     109To filter an inline component by e.g. type, you can a {{{filterby}}} option like in:
     110
     111{{{
     112    S3SQLInlineComponent(
     113        "contact",
     114        name="email",
     115        label=T("Email Addresses"),
     116        fields=["value"],
     117        filterby = dict(
     118            field = "contact_method",
     119            options = "EMAIL"
     120        )
     121    ),
     122}}}
     123
     124The filterby settings is a dict (or a list of dicts for multiple filters), containing:
     125
     126||'''Attribute'''||'''Explanation'''||
     127||field||the name of field to filter by||
     128||options||the allowed options for this field, a single value or a list of values||
     129||invert||True to invert this filter (default False)||
     130||default||default value for this field (if only one option is given and invert is False, then that option will automatically be the default value - unless you specify something else)||
     131
     132Where multiple sub-forms for the same component (but with different filters) shall be embedded, they must each have a distinct "name" argument. Otherwise this argument is optional.
    110133
    111134You can also specify a label (title) for the subform using the "label" argument (optional)
     
    121144- some form widgets may not yet be supported in inline-components (e.g. Autocompletes), or show unexpected behavior.
    122145- there is no specific CSS formatting for inline-components yet
    123 - Authorization of inline-components is incomplete
    124 - Filtering of inline-components is not implemented yet
     146- ~~Authorization of inline-components is incomplete~~
     147- ~~Filtering of inline-components is not implemented yet~~
    125148- Link-table components are not properly supported in inline-components yet
    126149