react-toolbox/components/dropdown
@soyjavi 2423d09a4f Rename component doc to readme.md 2015-10-28 22:09:09 +07:00
..
_config.scss More refactoring for sass variables 2015-10-21 01:06:04 +02:00
index.jsx update webpack dev, test and build & update eslint rule 2015-10-23 16:11:40 +08:00
readme.md Rename component doc to readme.md 2015-10-28 22:09:09 +07:00
style.scss More refactoring for sass variables 2015-10-21 01:06:04 +02:00

readme.md

Dropdown

var DropDown = require('react-toolbox/components/dropdown');

var countries: [
  value: 'ES-es', label: 'Spain', img: 'http://'
,
  value: 'TH-th', label: 'Thailand', img: 'http://'
,
  value: 'EN-gb', label: 'England', img: 'http://'
,
  value: 'EN-en', label: 'USA', img: 'http://'
,
  value: 'FR-fr', label: 'France', img: 'http://'
];

<DropDown dataSource={countries} value='TH-th' />

Properties

Name Type Default Description
className String Set the class-styles of the Component.
dataSource Array JSON data representing all items in the dropdown.
disabled Boolean false Set components disabled.
label String The text string to use for the floating label element.
onChange Function Callback function that is fired when the components's value changes.
template Function Callback function that represents a item for the component.
type String "normal" Type of the component, overwrite this property if you need set a different stylesheet.
value String Default value using JSON data.

Methods

getValue

Returns the value of the input.

dropdown_instance.getValue();
> 'TH-th'

setValue

Sets the value of the input element.

var new_value = 'ES-es'
dropdown_instance.setValue(new_value);