Version 19 (modified by rjollos, 13 months ago) (diff)

Improved documentation regarding simplejson.

Dynamically change field depending on value of parent


Dynamically change fields options by their parent fields.

Bugs/Feature Requests

Existing bugs and feature requests for TracTicketChainedFieldsPlugin are here.

If you have any issues, create a new ticket.


Download the zipped source from here.


You can check out TracTicketChainedFieldsPlugin from here using Subversion, or browse the source with Trac.


You can install this software as you would for any TracPlugin.

simplejson is a requirement for Python < 2.6, and it should be installed automatically if required when running easy_install.

  1. Uninstall TracTicketTemplate if you have installed before.
  1. Change to the directory containning
  1. If you want to install this plugin globally, that will install this plugin to the python path:
    • python install
  1. If you want to install this plugin to trac instance only:
    • python bdist_egg
    • copy the generated egg file to the trac instance's plugin directory
      cp dist/*.egg /srv/trac/env/plugins
  1. Config trac.ini:
    tcf.* = enabled
    hide_empty_fields = false
    chained_fields = tcf_brand, tcf_phone, tcf_os
    chained_fields = component, tcf_brand, tcf_phone, tcf_os
    for non-tcf_ starting fields.

hide_empty_fields is the option which enable "hide fields when there are no supplied options", default is false. See #5638 for more details.


For example, there are 3 fields: brand, phone, OS. When brand changes, phone field will change it's options to show only phone belongs to that brand. When phone changes, OS field will change too.

  1. Add 3 custom fields in trac.ini
    tcf_brand = text
    tcf_brand.label = Brand
    tcf_brand.order = 3
    tcf_phone = text
    tcf_phone.label = Phone
    tcf_phone.order = 4
    tcf_os = text
    tcf_os.label = OS
    tcf_os.order = 5
  2. Go to Admin -> Chained Fields, edit the config
        "tcf_brand": {
            "Nokia": {
                    "5800": {
                            "Symbian": {},
                            "Android": {}
            "SE": {
                    "": {
                            "": {}
            "Apple": {
                    "iPhone": {
                            "OS X": {},
                            "OS": {}
                    "iPhone 3G": {
                            "OS X": {},
                            "other": {}

Please note:

  • If no options for some fields, like "SE" above, you still need supply the full structure, with empty string as keys.
  • It supports any fields after [7793].


Recent Changes

[13753] by rjollos on 2014-03-15 22:02:59
0.2dev: Executed on source code.
[13752] by rjollos on 2014-03-15 22:02:50
0.2dev: Add simplejson to install requirements for Python < 2.6, otherwise use json.
[13751] by rjollos on 2014-03-15 22:02:43
0.2dev: Reformat JavaScript code.


Author: richard
Maintainer: richard

Attachments (1)

Download all attachments as: .zip