Add Select (dropdown) column type to tables #602
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello! I've been playing around with Lowcoder, and I wanted to have dropdowns in editable table columns, as requested in #412. I couldn't find it, so I quickly threw this together.
Let me know if any more changes are needed! I tried to touch similar files to those touched by d92f917, which added the Number column type, so hopefully not too many things have been forgotten.
Proposed changes
This PR adds a new Select column type to tables. It's specifically intended to allow inline edits to present a dropdown so users get some guidance on the allowed values, instead of a simple text field.
Example: the following screenshots show a Table component with its standard data (10 users with an ID, name, date and department). However, the Department column (which is usually a Text column) has been changed to a Select column and marked as Editable:
When editing a user's Department (by double-clicking that cell), it transforms into a dropdown:
Of course, clicking on the dropdown displays the available choices:
Once a different choice has been selected (and the cell unfocused), the cell is marked as having pending changes:
Saving the table emits an event which has the changed cell as part of the table's
changeSet
, where it would be handled as any other change. This notification is triggered on the Save Changes event of the table, and it prints{{table.changeSet}}
:Types of changes
Checklist