Changes between Version 60 and Version 61 of S3/S3REST/s3_rest_controller


Ignore:
Timestamp:
04/17/11 21:53:19 (14 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3REST/s3_rest_controller

    v60 v61  
    8484  - in standard views, the add-form in list views is hidden and can be activated by clicking the respective "Add Record" button. If {{{listadd=False}}}, then the "Add Record" button will redirect to the create-form view instead.
    8585  - these settings do not effect non-interactive representations
     86
     87=== List-Fields ===
     88
     89To control which fields appear in list views (and to prescribe the order of the columns), use the {{{list_fields}}}-setting. This setting takes a list of field names of the fields to be displayed:
     90
     91{{{
     92s3xrc.model.configure(table,
     93                      list_fields=["id", "name", "location_id"])
     94}}}
     95
     96  NOTE: If your view uses dataTables (which all default view templates do), then you '''must''' include {{{"id"}}} at the first place to have it working properly.
     97
     98For virtual fields, you should provide a tuple of {{{(T("FieldLabel"), "fieldname")}}}, because virtual fields do not have a {{{.label}}} setting (as they are functions and not {{{Field}}} instances):
     99
     100{{{
     101s3xrc.model.configure(table,
     102                      list_fields=[
     103                          "id",
     104                          "name",
     105                          "location_id",
     106                          (T("Total costs"), "total_costs")
     107                      ]
     108}}}
    86109
    87110=== List-add ===