You are here

Categories

Categories

One of the pieces of code in the library is categories, which can be used for creating drop down combos, check boxes, data lists and radio buttons. On top of these uses, you can use categories to manage site settings, emails and so much more

Category Header

The category header stores the category code which groups all the children in the category detail. In addition to the category code, there is the common name, description as well as the list and form design for the category detail. These last two pieces of information means that you can store a host of different information with in categories, depending on your application.

Category Detail

The category detail stores a lot of information, of which only some fields will be required depending on your application. In the simplest form, the category detail can just store:-

  • Category - This is the code in the header that links the children together
  • Code - This combined with the category form an unique index by which you can retrieve any record
  • Value - This is the value that is displayed to the user
  • Sequence - Order in which you want to display the records

If you are using the category to store information for a drop down combo for example then you may wish to store additional information such as:-

  • Group - This offers the facility so that you can group some details together, for example in the example shown, "Numeric" is a group
  • Title - Used for displaying useful information about the choice
  • Alternate Code - Because the category code creates an unique key, if you need to repeat a value in the drop down box like in the example shown INT and DATE are repeated, then this can be accommodated by using an alternate value. You can also use the alternate code to disable an option

On top of the above there are three space fields to store other information as well as an alternate value and a field to store JavaScript

FAQ

There are several questions that I have been asked with regard to the category code

  1. How easy is it to change the code?
    Very Easy - All the code generated by WDZ uses the class system, at its heart, so to change the code for categories, all you need to do is write a class that extends the base class.
     
  2. Can you use the categories data for another purpose?
    Yes - As you can store additional data with the categories detail as well as the header, then you can use this data for your own purposes.
     
  3. What is title used for?
    In some combos you can have additional information about the option displayed. The title will be this additional information.
     
  4. What is the group used for?
    You can group options together in an option group. If you need this feature then just add a group label at the start of the group.
     
  5. Is there anywhere where I can see the code in action?
    Look at the Demo, in particular creating fields. Here quite a few of the features are used.
     
  6. Are there any special codes or additions?
    Yes - For example if you wish to disable an option then use DISABLED in the alternate value as the category code creates an unique queue
     
  7. Have another question?
    Please send the question to support@web-d-zine.co.uk. We will get back to you within a week, with the answer.

Author: Gaynor Portlock

Category
Latest News
Best to bee organised
Even though I have only scratched the surface with regard to my current goal of either coding for Web-D-Zine(WDZ) Read more