Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

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

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 :)

Please Log in or Create an account to join the conversation.

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

I think I found my answer - is the Enumeration Field.

I wondered what that was for :)
Just call me Chris :)

Please Log in or Create an account to join the conversation.

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

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.

Please Log in or Create an account to join the conversation.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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

Please Log in or Create an account to join the conversation.

Last edit: by admin.
  • Page:
  • 1
Time to create page: 0.061 seconds

Freakin' Awesome!!! J-Cook is simply awesome - whether you're a highly experienced developer or complete novice whether you're building a small inventory component or a complete community solution! The beauty comes from a fast slick and reliable platform that readily provides developers with everything they'll need to build the backbone of a solid and secure component with wizards for authoring access publishing aliasing created/modified by dates... you name it COOK provides it! J-Cook really surpasses all of the 'competition' as far as MVC tools are concerned! Try love it and get cooking!
learnthrusong (JED)
          

Get Started