Skip to main content
Version: Next

Enums, Traits and Table Settings

Enums​

An enum is a fixed list of values for a property, for example country codes or priorities. Three parts work together (details in Lists, Enums & Virtual Properties):

  1. the enum (enums/<name>) with its entries,
  2. an enum property type (enum_property_type/<name>) that refers to the enum,
  3. a property of the entity type with this property type.

Enums have no entry in the administration menu. Open the list of enums with the address /search/enums.

Create an enum:

  1. On /search/enums, create a new enum with +.
  2. On its overview page, open the tab Lists and add the entries. Each entry has a value (stored technical value), a label (per language) and an optional int_value.
  3. Reorder entries by dragging the grip . Dragging is disabled while the list is filtered or sorted. The order of the list is the order in the dropdown.
  4. Create an enum property type under Administration → Datamodel → Property Types that points to the enum with enum_ref.
  5. Add a property with this property type to the entity type (see Properties).

Enum Priority with its entries The enum Priority: entries with value, label and integer value; drag handle to reorder, globe for translations

Removing entries

If you remove an entry that is in use, the property of the affected entities becomes empty.

Traits​

A trait adds a group of extra properties to a single entity — any entity, including an entity type (see Traits).

  1. Open the entity. If it has no traits yet, the tab Traits is hidden: show it with in the tab bar.
  2. Click + Trait. The dialog Add trait opens; find the trait with Filter traits....
  3. Fill in the values and click Submit.

The trait is saved at once and creates a commit of the entity. You can edit the values in the table of the tab. There is no way to remove a trait in the user interface.

Table Settings​

The columns of the search page of a type are its properties, including inherited and virtual ones, in the order of their position, plus metadata columns. The tooltip of a column header is the description of the property.

Default sort: apply the trait Entity Type UI Settings to the entity type (tab Traits of the type) and set:

FieldExample for Address
Sort by Propertystreet
Sort Orderascending

The search page of the type then opens sorted by this column.

Traits tab of Address The trait Entity Type UI Settings on the entity type Address

Default columns, column widths and column order cannot be saved — users can change them per session only.