Show case of how to use the plugin jquery to conditionally hide or display some fields in a form
To be continued.... In the mean time, see this:
YAML
preferences:
feature_trackers: y
feature_user_watches: y
instructions: Profile_Conditional_Display_in_Forms_instructions_page
objects:
-
type: tracker
ref: cdf
data:
name: CDF
description: Some fields will be shown/hidden based in selections in previous fields
default_status: open
list_default_status: opc
restrict_end: 0
section_format: flat
restrict_start: 0
show: [ status, creation_date, modification_date, list_modification_date ]
allow: [ comments, attachments ]
-
type: tracker_field
ref: cdf_id
data:
name: '#Id'
permname: id
tracker: $profileobject:cdf$
options:
start: 1
prepend: '#'
type: auto_increment
order: 0
flags:
- list
- searchable
- public
- mandatory
-
type: tracker_field
ref: cdf_campText
data:
name: Title of item (as a Text field)
permname: campText
tracker: $profileobject:cdf$
options:
samerow: 1
size: 80
max: 100
autocomplete: y
exact: n
type: text_field
order: 10
flags:
- link
- list
- searchable
- public
- mandatory
-
type: tracker_field
ref: cdf_header
data:
name: Header
permname: header
tracker: $profileobject:cdf$
options:
level: 1
toggle: o
type: header
order: 20
flags:
- searchable
- public
-
type: tracker_field
ref: cdf_usuari
data:
name: User field
permname: usuari
tracker: $profileobject:cdf$
options:
autoassign: 1
groupIds:
- 0
type: user
order: 30
flags:
- searchable
- public
-
type: tracker_field
ref: cdf_campRadioButton
data:
name: Which is your case?
permname: campRadioButton
tracker: $profileobject:cdf$
options:
options:
- 0=Case A
- 1=Case B
- 3=Unknown
type: radio
order: 40
flags:
- list
- searchable
- public
-
type: tracker_field
ref: cdf_campNumeric
data:
name: Case B Numeric field
permname: campNumeric
tracker: $profileobject:cdf$
options:
samerow: 1
size: 20
dec_point: .
thousands: ,
type: numeric
order: 50
flags:
- searchable
- public
-
type: tracker_field
ref: cdf_campDesplegableAmbAltres
data:
name: Case B Dropdown with other field
permname: campDesplegableAmbAltres
tracker: $profileobject:cdf$
options:
options:
- 0
- 1
- 2
- 3
type: dropdown_other
order: 60
flags:
- searchable
- public
-
type: tracker_field
ref: cdf_data
data:
name: Case B date time field
permname: data
tracker: $profileobject:cdf$
options:
datetime: dt
startyear: 2001
endyear: 2016
blankdate: blank
type: datetime
order: 70
flags:
- searchable
- public
-
type: tracker_field
ref: cdf_campAreaDeText
data:
name: Case B Text area field
permname: campAreaDeText
tracker: $profileobject:cdf$
options:
toolbars: 1
width: 80
height: 5
max: 10000
listmax: 200
distinct: n
wysiwyg: n
samerow: 1
type: text_area
order: 80
description: >
Pots afegir més informació i
comentaris aquí
descparsed: y
flags:
- searchable
- public
-
type: tracker_field
ref: cdf_campDatepicker
data:
name: Case B datepicker field
permname: campDatepicker
tracker: $profileobject:cdf$
options:
datetime: dt
type: calendar
order: 90
flags:
- searchable
- public
-
type: tracker_field
ref: cdf_staticText
data:
name: Case A. Static Text
permname: staticText
tracker: $profileobject:cdf$
options:
wikiparse: 1
max: 100
type: static
order: 100
description: >
My ~~red:description~~ as ''__static
text__'' comes here
descparsed: y
flags:
- searchable
- public
-
type: tracker_field
ref: cdf_multiSelectCheckboxes
data:
name: Case A. Multiple Selection Checkboxes
permname: multiSelectCheckboxes
tracker: $profileobject:cdf$
options:
options:
- 0=foo
- 1=bar
- 2=oh yeah
type: multiselect
order: 110
flags:
- searchable
- public
-
type: tracker_field
ref: cdf_multiSelectList
data:
name: Case A. Multiple Selection List
permname: multiSelectList
tracker: $profileobject:cdf$
options:
options:
- 0=foo
- 1=bar
- 2=oh yeah
inputtype: m
type: multiselect
order: 120
flags:
- searchable
- public
-
type: tracker_field
ref: cdf_computedField
data:
name: Case A. Computed field
permname: computedField
tracker: $profileobject:cdf$
options:
formula: $unknownobject:553a62041fa9a$
type: computed
order: 130
description: |
Computed based on a formula. For dates, it shows: y=years, m=months, w=weeks, d=days, h=hours
flags:
- searchable
- public
-
type: tracker_field
ref: cdf_campDesplegable
data:
name: Common Drop down field
permname: campDesplegable
tracker: $profileobject:cdf$
options:
options:
- 1
- 2
- 2
- 3
type: dropdown
order: 140
description: for all cases (A, B or unknown)
flags:
- searchable
- public
-
type: tracker_option
ref: cdf_sort_default_field
data:
tracker: $profileobject:cdf$
name: sort_default_field
value: modification
Sample data
YAML
objects:
-
type: tracker_item
ref: item_001
data:
tracker: $CDF:cdf
status: open
values:
- [ $CDF:cdf_campText, Sample issue 1 ]
-
type: tracker_item
ref: item_002
data:
tracker: $CDF:cdf
status: pending
values:
- [ $CDF:cdf_campText, Sample issue 2 ]
Modules
YAML
objects:
-
type: module
ref: module_last_modif_tracker_items
data:
name: last_modif_tracker_items
groups: [ Anonymous, Registered ]
position: right
order: 5
params:
trackerId: $cdf
name: Summary
-
type: module
ref: module_last_tracker_comments
data:
name: last_tracker_comments
groups: [ Anonymous, Registered ]
position: right
order: 9
This will include:
Profile_Conditional_Display_in_Forms_instructions_page
YAML
instructions: Conditional_Display_in_Forms_instructions
preferences:
enable: [ feature_wiki ]
objects:
-
type: wiki_page
ref: cdf_page
data:
name: Conditional_Display_in_Forms_instructions
description: How it works
lang: en
content: wikicontent:Profile_Conditional_Display_in_Forms_instructions_page