Menu

BETTER OPTION: Ability to create custom drop down lists on fields

+5 votes

It would be extremely useful for me to be able to make fields appear as custom drop down lists in the UI only, so that I can restrict the input of my user's to only the selections available in the custom list.

This is implemented partially in the Regex editor, but I would really like to be able to create and manage lists for fields that would hold short sentences rather than singular characters or words.

This is also kind of possible through separating the list out into its own table in the backend and linking it to the main table with a FK, but it would make the backend quite a bit more complex/messy than needed.

in Features (Skip) by (970 points)
recategorized by

1 Answer

0 votes
 
Best answer

You are definitely not the first person to request custom UI only dropdowns.

I understand the idea that it feels simpler since there is less work required at the database level. At the same time, I have to think that the database is the best place for these lists. Even if they are tiny. The reasons are:

  • Referential integrity,
  • Security,
  • Easy to extend with additional columns for help or extra detail,
  • Lists available for all systems that access the database, not just dbFront,
  • Easy and robust maintenance via the database or dbFront,
  • Makes the database more self documented...

In addition, dbFront now includes a table tool to quickly create a SQL script that will turn a table column into a lookup table.

I would very much appreciate hearing reasons why creating a lookup table is not the best solution. Please add those reasons as comments to this answer.

by (65.1k points)
edited by

I entirely agree with Anthony on this. The place to do this is in the database with foreign keys to a look-up table. It's what dbFront is designed to do. Putting extra functionality into dbFront to do this just means the dbFront developers are wasting time re-inventing something that works perfectly well at present.

Those are fair points. I will be interested to try the script out.
I agree with all this, though it would be nice if DBFront recognized MySQL enums as lookups, though.
Supporting MySQL and Oracle Enums as DropDowns sounds like a very good idea.  I created a new feature request based on your suggestion.
I moved the Enum column support request to its own feature.  Please vote on that one if it interests you.  I am going to consider the generic request for a custom dropdowns complete. I don't plan to support it at this point.  I am always open to more input if someone disagrees.
Welcome to the dbFront Q&A site, where you can ask questions and receive answers from other members of the community.
 | Minimalist Answer Theme by Digitizor Media
 |
Powered by Question2Answer
...