Last active
December 12, 2019 15:10
-
-
Save MotiurRahman/9c62e018f0bb552e61dff80fe83b51e5 to your computer and use it in GitHub Desktop.
AlertDialog Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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===2) { | |
alert("You Click Help"); | |
} | |
}); | |
// Listen for click events. | |
TestDialog.addEventListener('click', function() { | |
dialog.show(); | |
Ti.API.info("testing"); | |
}); | |
// Add to the parent view. | |
win.add(TestDialog); | |
win.open(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment