Changes between Version 9 and Version 10 of S3/S3SQLForm


Ignore:
Timestamp:
02/21/13 09:29:29 (11 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3SQLForm

    v9 v10  
    143143
    144144It is possible to sort the inline-items by specifying an {{{orderby}}} option with a field selector relative to the component table:
    145 
    146145{{{
    147146    s3forms.S3SQLInlineComponent(
     
    153152}}}
    154153
    155 To specify a different sort order, the {{{orderby}}}-option also accepts a tuple like: {{{("location_id$name", "desc")}}} (default is "asc").
     154To specify a different sort order, the {{{orderby}}}-option also accepts a tuple like:
     155{{{
     156    s3forms.S3SQLInlineComponent(
     157        "location",
     158        label = T("Countries"),
     159        fields = ["location_id"],
     160        orderby = ("location_id$name", "desc")
     161    ),
     162}}}
     163
     164The sort order defaults to "asc".
    156165
    157166    '''Note:''' the field selector used in orderby must give exactly one value per row (i.e. use only forward-links, not component fields or list:types), otherwise the same component item would appear multiple times in the form (due to the left join involved).