Skip to content

Instantly share code, notes, and snippets.

@MotiurRahman
Last active December 12, 2019 15:10
Show Gist options
  • Select an option

  • Save MotiurRahman/9c62e018f0bb552e61dff80fe83b51e5 to your computer and use it in GitHub Desktop.

Select an option

Save MotiurRahman/9c62e018f0bb552e61dff80fe83b51e5 to your computer and use it in GitHub Desktop.

Revisions

  1. MotiurRahman revised this gist Dec 12, 2019. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions app.js
    Original file line number Diff line number Diff line change
    @@ -37,6 +37,7 @@
    // Listen for click events.
    TestDialog.addEventListener('click', function() {
    dialog.show();
    Ti.API.info("testing");

    });

  2. MotiurRahman revised this gist Dec 12, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion app.js
    Original file line number Diff line number Diff line change
    @@ -27,7 +27,7 @@
    alert("You Click Confirm");
    } else if (e.index === 1) {
    alert("You Click Cancel");
    } else if (e.index) {
    } else if (e.index===2) {
    alert("You Click Help");

    }
  3. MotiurRahman created this gist Dec 12, 2019.
    46 changes: 46 additions & 0 deletions app.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,46 @@

    var win = Ti.UI.createWindow({
    title : 'AlertDialog Window',
    backgroundColor : 'white',
    exitOnClose : true,
    fullscreen : false
    });

    // Create a Button.
    var TestDialog = Ti.UI.createButton({
    title : "TestDialog",
    top : 400,
    height : Ti.UI.SIZE,
    width : Ti.UI.SIZE

    });

    var dialog = Ti.UI.createAlertDialog({
    buttonNames : ['Confirm', 'Cancel', 'Help'],
    message : 'Would you like to delete the file?',
    title : 'Delete'
    });

    dialog.addEventListener("click", function(e) {

    if (e.index === 0) {
    alert("You Click Confirm");
    } else if (e.index === 1) {
    alert("You Click Cancel");
    } else if (e.index) {
    alert("You Click Help");

    }

    });

    // Listen for click events.
    TestDialog.addEventListener('click', function() {
    dialog.show();

    });

    // Add to the parent view.
    win.add(TestDialog);

    win.open();