Welcome, Guest
Username: Password: Remember me

TOPIC: Creating a Dropdown or Radio without FK table

Creating a Dropdown or Radio without FK table 06 Jul 2016 06:59 #14154

  • organicwebs
  • organicwebs's Avatar
  • Offline
  • Premium Member
  • Chris
  • Posts: 133
  • Thank you received: 21
  • Karma: 4
Hi,
I would like to create a basic dropdown list - or radio button - with 3 items (Yes, No, Not Applicable) - without creating a table for it.

I have lots of these to do, and the values are all a little different. Creating tables for each one isn't really viable (too many).

I guess I can fork the code if I have too.

Is there a way with the Online Generator?

Grateful for any pointers...
Just call me Chris :)
The administrator has disabled public write access.

Creating a Dropdown or Radio without FK table 06 Jul 2016 07:23 #14156

  • organicwebs
  • organicwebs's Avatar
  • Offline
  • Premium Member
  • Chris
  • Posts: 133
  • Thank you received: 21
  • Karma: 4
I think I found my answer - is the Enumeration Field.

I wondered what that was for :)
Just call me Chris :)
The administrator has disabled public write access.

Creating a Dropdown or Radio without FK table 06 Jul 2016 09:36 #14158

  • Romkabouter
  • Romkabouter's Avatar
  • Offline
  • Elite Member
  • Posts: 310
  • Thank you received: 131
  • Karma: 48
Indeed :)

I personally try to use the enum only for thing that are highly unlikely to change, such as "gender"
When you use an enumeration, you loose flexibility.
The administrator has disabled public write access.

Creating a Dropdown or Radio without FK table 06 Jul 2016 12:20 #14160

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
I think @organicweb is correct. Enum is the best choice for that.
They are translatable strings, and you can edit them in the helper. I think it is flexible.

What I think it that they are not properly coded. I have to rewrite this part in future.
They WILL be located in
helpers/html/lists.php
And the call you not pass through the view file (too heavy). It will be a simple static call from the template.
For the moment, is is working anyways.

EDIT : And in the form, you can change the aspect (combo / radio / list)
Coding is now a piece of cake
Last Edit: 06 Jul 2016 12:22 by admin.
The administrator has disabled public write access.
Time to create page: 0.084 seconds

Get Started