The labkey.org server will offline for a restart at 7pm Pacific Time today. The server will be offline for no more than 15 minutes. Sorry for any inconvenience this may cause.
{
"survey" : {
"layout" : "auto",
"showCounts" : false,
"sections" : [ {
"questions" : [ {
"extConfig": {
"xtype": "panel",
"html": "<h2>Survey Instructions</h2><p><b>Hat Size</b><img
src='FULL_URL_TO_HAT_IMAGE'
height='100' width='100'/></p><p>Please select your hat size.</p><p><b>Weight</b>
<img src='FULL_URL_TO_SCALE_IMAGE'
height='100' width='100'/></p><p>Please specify your current weight in kilograms.
</p>"
}
}, {
"name" : "HatSize",
"caption" : "Hat Size",
"shortCaption" : "HatSize",
"hidden" : false,
"jsonType" : "string",
"inputType" : "text",
"lookup" : {
"schema" : "lists",
"keyColumn" : "HatSizeName",
"public" : true,
"displayColumn" : "HatSizeName",
"isPublic" : true,
"queryName" : "HatSizes",
"containerPath" : "/Tutorials/Survey Demo",
"schemaName" : "lists",
"table" : "HatSizes"
},
"required" : false,
"width" : 800
}, {
"name" : "Weight",
"caption" : "Weight",
"shortCaption" : "Weight",
"hidden" : false,
"jsonType" : "int",
"inputType" : "text",
"required" : false,
"width" : 800
} ],
"description" : null,
"header" : true,
"title" : "HatSizeAndWeight",
"collapsible" : true,
"defaultLabelWidth" : 350
} ]
}
}
Download the JSON code for this example: survey-Skip1.json
The JSON metadata example for the 'DaysSick' field, for example, looks like this:
...{
"name" : "DaysSick",
"caption" : "Days Sick",
"shortCaption" : "Days Sick",
"hidden" : false,
"jsonType" : "string",
"inputType" : "text",
"required" : false,
"width" : 800,
"hidden": true,
"listeners" : {
"change" : {
"question" : "sick",
"fn" : "function(me, cmp, newValue, oldValue){if (me) me.setVisible(newValue == 'Yes');} "
}
}
},...
{
"survey" : {
"start": {
"useDefaultLabel": true
},
"sections" : [{
...{
"jsonType": "int",
"hidden": false,
"width": 800,
"inputType": "text",
"name": "lkfield",
"caption": "Lookup Field",
"shortCaption": "Lookup Field",
"required": false,
"lookup": {
"keyColumn": "Key",
"displayColumn": "Value",
"schemaName": "lists",
"queryName": "allSOPs",
"viewName": "activeSOPs",
"containerPath": "/Project/..."
}
}"questions": [
{
"extConfig": {
"width": 800,
"xtype": "textfield",
"name": "test",
"labelAttrTpl": " data-qtip='This tooltip should appear on the field label'",
"fieldLabel": "Field with tooltips"
}
}
],
{
"jsonType": "string",
"hidden": false,
"width": 800,
"inputType": "file",
"name": "attfield",
"caption": "Attachment Field",
"shortCaption": "Attachment Field",
"required": false
}{
"jsonType": "boolean",
"hidden": false,
"width": 800,
"inputType": "checkbox",
"name": "boolfield",
"caption": "Boolean Field",
"shortCaption": "Boolean Field",
"required": false
}{
"extConfig": {
"xtype": "fieldcontainer",
"width": 800,
"hidden": false,
"name": "checkbox_group",
"margin": "10px 10px 15px",
"fieldLabel": "CB Group (ExtJS)",
"items": [{
"xtype": "panel",
"border": true,
"bodyStyle":"padding-left:5px;",
"defaults": {
"xtype": "checkbox",
"inputValue": "true",
"uncheckedValue": "false"
},
"items": [
{
"boxLabel": "CB 1",
"name": "checkbox_1"
},
{
"boxLabel": "CB 2",
"name": "checkbox_2"
},
{
"boxLabel": "CB 3",
"name": "checkbox_3"
}
]
}]
}
}{
"jsonType": "int",
"hidden": false,
"width": 800,
"inputType": "text",
"name": "lkfield",
"caption": "Lookup Field",
"shortCaption": "Lookup Field",
"required": false,
"lookup": {
"keyColumn": "Key",
"displayColumn": "Value",
"schemaName": "lists",
"queryName": "lookup1",
"containerPath": "/Project/..."
}
}{
"extConfig": {
"width": 800,
"hidden": false,
"xtype": "combo",
"name": "comboField",
"fieldLabel": "Combobox (ExtJS)",
"queryMode": "local",
"displayField": "value",
"valueField": "value",
"emptyText": "Select...",
"forceSelection": true,
"store": {
"fields": ["value"],
"data" : [
{"value": "Value1"},
{"value": "Value2"}
]
}
}
}{
"jsonType": "date",
"hidden": false,
"width": 800,
"inputType": "text",
"name": "dtfield",
"caption": "Date Field",
"shortCaption": "Date Field",
"required": false
}{
"extConfig": {
"width": 800,
"xtype": "datetimefield",
"name": "dtfield",
"fieldLabel": "DateTime Field"
}
}{
"extConfig": {
"width": 800,
"xtype": "displayfield",
"name": "dsplfield",
"hideLabel": true,
"value": "Some text."
}
}{
"jsonType": "float",
"hidden": false,
"width": 800,
"inputType": "text",
"name": "dblfield",
"caption": "Double Field",
"shortCaption": "Double Field",
"required": false
}{
"jsonType": "int",
"hidden": false,
"width": 800,
"inputType": "text",
"name": "intfield",
"caption": "Integer Field",
"shortCaption": "Integer Field",
"required": false
}{
"extConfig": {
"xtype": "fieldcontainer",
"fieldLabel": "Number Range",
"margin": "10px 10px 15px",
"layout": "hbox",
"width": 800,
"items": [
{
"xtype": "numberfield",
"fieldLabel": "Min",
"name": "min_num",
"width": 175
},
{
"xtype": "label",
"width": 25
},
{
"xtype": "numberfield",
"fieldLabel": "Max",
"name": "max_num",
"width": 175
}
]
}
}{
"extConfig": {
"xtype": "numberfield",
"fieldLabel": "Positive Integer",
"name": "pos_int",
"allowDecimals": false,
"minValue": 0,
"width": 800
}
}{
"extConfig": {
"xtype": "surveygridquestion",
"name": "gridquestion",
"columns": {
"items": [{
"text": "Field 1",
"dataIndex": "field1",
"width": 350,
"editor": {
"xtype": "combo",
"queryMode": "local",
"displayField":"value",
"valueField": "value",
"forceSelection": true,
"store": {
"fields": ["value"],
"data" : [{
"value": "Value 1"
}, {
"value": "Value 2"
}, {
"value": "Value 3"
}]
}
}
},
{
"text": "Field 2",
"dataIndex": "field2",
"width": 200,
"editor": {
"xtype": "textfield"
}
},
{
"text": "Field 3",
"dataIndex": "field3",
"width": 200,
"editor": {
"xtype": "textfield"
}
}]
},
"store": {
"xtype": "json",
"fields": [
"field1",
"field2",
"field3"
]
}
}
}{"survey":{
"headerWiki": {
"name": "wiki_name",
"containerPath": "/Project/..."
},
"footerWiki": {
"name": "wiki_name",
"containerPath": "/Project/..."
},
...
}{
"jsonType": "string",
"hidden": false,
"width": 800,
"inputType": "textarea",
"name": "txtfield",
"caption": "Textarea Field",
"shortCaption": "Textarea Field",
"required": false
}{
"survey" : {
"layout" : "auto",
"showCounts" : false,
"disableAutoSave" : true,
"sections" : [ {...{
"survey" : {
"layout" : "auto",
"showCounts" : false,
"autoSaveInterval" : 120000,
"disableAutoSave" : false,
"sections" : [ {...