/ti-better-option-dialog

A wrapper for Titanium's Option Dialog that makes it simpler to add option buttons.

Primary LanguageJavaScript

Better Titanium Option Dialog

gitTio Dependencies Dev Dependencies

A wrapper for Titanium's Option Dialog that makes it simpler to add option buttons.

Demonstration

Demonstration

Usage

Installation

Download the latest distribution ZIP-file and consult the Titanium Documentation on how install it, or simply use the gitTio CLI:

gittio install com.magana.betteroptiondialog

Example

var BetterOptionDialog = require('com.magana.betteroptiondialog');

var optionDialog = BetterOptionDialog.create({
    options: [
        {
            callback: function (optionDialogEventData) {
                // Code to delete something here
            },
            destructive: true,
            title: 'Delete'
        },
        {
            callback: function (optionDialogEventData) {
                // Code to save something here
            },
            title: 'Save'
        }
    ],
    showCancel: true, // Will automatically add a cancel button to the option dialog
    title: 'Better Option Dialog!'
});

optionDialog.show();

Credits

License

This library, betteroptiondialog, is free software ("Licensed Software"); you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; including but not limited to, the implied warranty of MERCHANTABILITY, NONINFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA