| Platform | Since |
|---|---|
| Android | 0.8 |
| iPhone | 0.8 |
| iPad | 0.8 |
The Option Dialog is created by Titanium.UI.createOptionDialog and allows you to show a modal dialog of one or more options to the user.
In this example, we show a simple option dialog.
var dialog = Titanium.UI.createOptionDialog({ title: 'Hello', options: ['Option 1','Option 2'], cancel:1 }); dialog.show();
| Name | Summary |
|---|---|
| addEventListener |
Adds the specified callback as an event listener for the named event. |
| fireEvent |
Fires a synthesized event to any registered listeners. |
| getAndroidView |
Gets the value of the androidView property. (Android only.) |
| getCancel |
Gets the value of the cancel property. |
| getDestructive |
Gets the value of the destructive property. |
| getOptions |
Gets the value of the options property. |
| getSelectedIndex |
Gets the value of the selectedIndex property. (Android only.) |
| getTitle |
Gets the value of the title property. |
| getTitleid |
Gets the value of the titleid property. |
| removeEventListener |
Removes the specified callback as an event listener for the named event. |
| setAndroidView |
Sets the value of the androidView property. (Android only.) |
| setCancel |
Sets the value of the cancel property. |
| setDestructive |
Sets the value of the destructive property. |
| setOptions |
Sets the value of the options property. |
| setSelectedIndex |
Sets the value of the selectedIndex property. (Android only.) |
| setTitle |
Sets the value of the title property. |
| setTitleid |
Sets the value of the titleid property. |
| show |
cause the dialog to become visible |
| Name | Type | Summary |
|---|---|---|
| androidView | Object |
A Titanium.UI.View. Allows for arbitrary contents inside a native dialog. Works for any dialog. (Android only.) |
| cancel | Number |
an index to indicate which button should be the cancel button. If no button should be the cancel button, use -1. If there is a cancel button, it MUST be the last button for use on iPad. |
| destructive | Number |
the destructive button (indicated by a visual clue in the UI) |
| options | Array<Object> |
array of button names as strings |
| selectedIndex | Number |
set an initially selected option. Only valid when options has been specified. (Android only.) |
| title | String |
the title of the dialog |
| titleid | String |
the key in the locale file to use for the title property |
| Name | Summary |
|---|---|
| click |
fired when a button in the dialog is clicked |