/alloy_dropdown_field

Crossplatform dropdown picker widget for Appcelerator Alloy. Requires libraries from https://github.com/rafbel/titanium_libraries.

Primary LanguageJavaScript

Dropdown Field

Single ropdown picker for Android and iOS.

Overview

This widget looks exactly like a dropdown picker. The images below show the design of the widget on iOS (since on Android it is pretty much a default dropdown picker)

When clicked, an option dialog opens up and the user is able to select an option from the list.

Check it out! Your option is now selected!

Use it on your app!

Alloy
<Widget id="myDropdownField" src="dropdownField"/>
Controller
/* Params:
* an array with all available options
* default text to show on the field to be presented on the screen (the one similar to the picker)
* callback function to be called when an option is selected (optional argument)
*/
$.myDropdownField.initialize(optionsArray,dropdownDefaultText, function(selectedOption)
{
    console.log(selectedOption);
}); 

The widget comes with many other functions such as setTop, setWidth, setLeft,getDropdownValue,setDropdownValue, getSelectedIndex, resetValue, and setVisibility.

Some libraries from https://github.com/rafbel/titanium_libraries are required.