Skip to content

HowToReferencedFields

iraichi edited this page Apr 24, 2015 · 6 revisions

How to show fields from a referenced model

If you want to show in a Grid or in a Form field from a referenced model you have to customize the MainTable/Fields node of the view.

Example from [HelloKitto] (HelloKitto):

# model girl.yaml
ModelName: Girl
....
Fields:
......
  Phone: String(16)
    Rules:
      SubType: phone_number
# view dolls.yaml
Type: Data
Controller: List
.....
MainTable:
  Model: Doll
  Fields:
.....
    Mom:
    Mom.Phone: Mom_Phone
      DisplayLabel: _(Mom's Phone)

ReferencedFieldsGrid.png ReferencedFieldsForm.png

Clone this wiki locally