Material Design Lite selectfield component material-design-lite
Check out the example
There are three ways to install getmdl-select:
Using npm: Use this command in your command line:npm install getmdl-select
Using Bower: Use this command in your command line:bower install getmdl-select
Clone the repo using Git:git clone https://github.com/CreativeIT/getmdl-select.git
(Alternatively you can download this repository.) And then:cd getmdl-selectnpm install
<head> section of the page, as described in the MDL Introduction.
<!-- getmdl --><!--getmdl-select-->
Simple select field. To see other examples visit this page.
If you want to use more than one getmdl-select item use different ids for inputs and don't forget to change
for attributes. It works wrong without this.
For dynamically usage, you must add
"#mySelect"), after new item is created or any new element added to existing list.
li should have its own
data-val attribute. Choosing any element of select you change
value of hidden
data-val property of corresponding
li. Also you change
value of readonly
li.textContent. Then after form submit, next pair
hiddenInputName=hiddenInputValue will send to server side.
To set pre-selected value add
data-selected="true" attribute to corresponding
li in your list.
Initial Select takes the default width (300px). You can change it by overriding the CSS property
Options list automatically adapt to the maximum height by content. If you want to use small height (300px) and see scroll bar, add class
See the LICENSE file for license rights and limitations (MIT).