Changes between Version 9 and Version 10 of S3/S3SQLForm
- Timestamp:
- 02/21/13 09:29:29 (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
S3/S3SQLForm
v9 v10 143 143 144 144 It is possible to sort the inline-items by specifying an {{{orderby}}} option with a field selector relative to the component table: 145 146 145 {{{ 147 146 s3forms.S3SQLInlineComponent( … … 153 152 }}} 154 153 155 To specify a different sort order, the {{{orderby}}}-option also accepts a tuple like: {{{("location_id$name", "desc")}}} (default is "asc"). 154 To 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 164 The sort order defaults to "asc". 156 165 157 166 '''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).