Jump to content

Styling of forms seems to work for some fields but not others


Ant

Recommended Posts

Hi,

Is it possible to style selects within the JSON code like

"options": {
          "input_width": "15em"
        }

or do I have to use CSS to do it? or some other method?

I've found that it seems to work for some fields and not others.

 

This is the code that I have been playing with

 

{
	"title": "Resume",
	"type": "array",
	"items": {
		"title": "WORK EXPERIENCE",
		"properties": {
			"details": {
				"title": "Details",
				"type": "object",
				"format": "table",
				"properties": {
					"position": {
						"title": "Position",
						"type": "string",
						"options": {
							"input_width": "100%",
							"grid_columns": 11
						}
					},
					"monthstart": {
						"title": "Start Month",
						"$ref": "#\/definitions\/months",
						"type": "string",
						"options": {
							"input_width": "10em"
						}
					},
					"yearstart": {
						"title": "Start Year",
						"$ref": "#\/definitions\/years",
						"type": "string"
					},
					"monthend": {
						"title": "End Month",
						"$ref": "#\/definitions\/months",
						"type": "string"
					},
					"yearend": {
						"title": "End Year",
						"$ref": "#\/definitions\/years",
						"type": "string"
					},
					"companyname": {
						"title": "Company",
						"type": "string",
						"options": {
							"input_width": "100%",
							"grid_columns": 11
						}
					},
					"location": {
						"title": "Location",
						"type": "string",
						"options": {
							"input_width": "100%",
							"grid_columns": 11
						}
					},
					"information": {
						"title": "Information",
						"type": "string",
						"format": "textarea",
						"options": {
							"input_width": "100%",
							"grid_columns": 11
						}
					}
				}
			},
			"Duties": {
				"title": "Tasks/Responsibilities",
				"type": "array",
				"format": "table",
				"items": {
					"title": "Task",
					"type": "object",
					"format": "grid",
					"properties": {
						"task": {
							"title": "Task",
							"type": "string"
						}
					}
				}
			}
		}
	},
	"definitions": {
		"months": {
			"type": "string",
			"enumSource": [{
					"source": [{
							"value": "JAN",
							"title": "January"
						}, {
							"value": "FEB",
							"title": "February"
						}, {
							"value": "MAR",
							"title": "March"
						}, {
							"value": "APR",
							"title": "April"
						}, {
							"value": "MAY",
							"title": "May"
						}, {
							"value": "JUN",
							"title": "June"
						}, {
							"value": "JUL",
							"title": "July"
						}, {
							"value": "AUG",
							"title": "August"
						}, {
							"value": "SEP",
							"title": "September"
						}, {
							"value": "OCT",
							"title": "October"
						}, {
							"value": "NOV",
							"title": "November"
						}, {
							"value": "DEC",
							"title": "December"
						}
					],
					"title": "{{item.title}}",
					"value": "{{item.value}}"
				}
			]
		},
		"years": {
			"type": "string",
			"enumSource": [{
					"source": [{
							"value": "PRESENT",
							"title": "PRESENT"
						}, {
							"value": "1902",
							"title": "1902"
						}

					],
					"title": "{{item.title}}",
					"value": "{{item.value}}"
				}
			]
		}
	}
}

Any pointers would be much appreciated. Thanks.

Link to comment
×
×
  • Create New...