Skip to content
George Joseph edited this page Oct 20, 2019 · 1 revision

Derived from Element -> Widget

A simple HTML "select" box.

This is from the Jog example.

{
	/*
	 * All attributes of Element and Widget apply here.
	 */

	"id": "jog_y_speed",
	"type": "select",
	"style": {
		"width": "8ch"
	},
	"position": {
		"my": "right top",
		"at": "left top+30",
		"of": "#jog_y"
	},
	
	"options": [
		{"label": "10", "value": 600},
		{"label": "20", "value": 1200},
		{"label": "30", "value": 1800},
		{"label": "60", "value": 3600},
		{"label": "90", "value": 5400},
		{"label": "120", "value": 7200}
	],
	
	/*
	 * If you don't want to trigger the actions every time the
	 * selection changes, set this to false (or omit it) and send the
	 * DUEUI.EVENTS.SUBMIT event to this widget.
	 */ 
	"submit_on_change": true,
	
	"actions": [
		{"type": "setting", "setting": "jog_y_speed", "fire_on_startup": true},
		{"type": "event", "event": "jog_speed", "target": "#jog_y", "fire_on_startup": true}
	]
}

Send the submit event to the select box.

{
	"id": "submit_button,
	"type": "button",
	"value": "Submit",
	"actions": {"type": "event", "event": DUEUI.EVENTS.SUBMIT, "target": "#some_select_box"}
}

Clone this wiki locally