-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
help wantedExtra attention is neededExtra attention is neededquestionFurther information is requestedFurther information is requested
Description
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.
- HTML file is (with card view configuration): https://github.com/Boavizta/ict-sustainability-tools/blob/main/index.html
- fields properties are: https://github.com/Boavizta/ict-sustainability-tools/blob/main/ictst/widget/tools.fields-custom-properties.json
- Model is defined here: https://github.com/Boavizta/ict-sustainability-tools/blob/main/ictst/model/tools.frictionless-table-schema.json
- Data is: https://github.com/Boavizta/ict-sustainability-tools/blob/main/ictst/data/tools.csv
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is neededquestionFurther information is requestedFurther information is requested