ludo.form.Select

ludo.form.


new ludo.form.Select(config)

Select box (<select>)

Parameters:
Name Type Description
config Object
Properties
Name Type Description
valueKey String

Name of key used for value, example: "value"

textKey String

Name of key used for displayed text, example: "text"

emptyItem. Object

Object shown when no value selected, example: { "text": "Please select", value: "" }

options. Array

Array of values, example: [{value:1, text: "First item"},{value:2, text:"Second item" }]

Source:
Examples
{
		 type:'form.Select',
		 name:'country',
		 valueKey:'id',
		 textKey:'title',
		 emptyItem:{
			 id:'',title:'Where do you live?'
		 },
		 dataSource:{
			 resource:'Country',
			 service:'read'
		 }
	 }
 to populate the select box from the Country service on the server. The "id" column will be used as value for the options
 and title for the displayed text.

 
{
		 type:'form.Select',
		 emptyItem:{
			 value:'',text:'Please select an option'
		 },
		 options:[
			 { value:'1',text : 'Option a' },
			 { value:'2',text : 'Option b' },
			 { value:'3',text : 'Option c' }
		 ]
	 }

Methods


addOption(value, text)

Add new option element

Parameters:
Name Type Description
value String
text String
Source: