Skip to content

How to implement a drop down list in Datami when editing data #133

@demeringo

Description

@demeringo

Problem

How to implement a drop down list in Datami when editing data

See issue #128

Solution

For a given field, I would like to constraint the values that can be input in the UI (a kind of drop down list that allow to select only one value).

  • The user should e able to select as single value (only one)
  • The list of authorized values is fixed (user is not allowed to add a custom value. User has to select one of the existing among the proposed choices).
  • Optionally, selecting a value should be mandatory (no blank/empty value allowed).

Describe how to configure this behavior:

  • in the table view
  • in the card (or mini card) view

Document the files to be edited and provide an example of this configuration.

A good example is the status field that should allow a user to pick one (and only one) of the 4 different predefined values.

This issue is not about data validation after the form is submitted, this point is already known.

Alternatives

For the time being, we configure such field as a string with subtype tag (singular). It mostly works but poses 2 problems:

  • User is able to propose an additional value for this field (a value that was not in the initial list).
  • The drop down list displayd when editing seems to be populated based on the values already present in the data table, not based on the configuration file.

Additional context or elements

We are talking about a csv data table.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions