NKAlertSheet
Overview
This class is used to confirm user destructive actions or provide a choice between different actions.
init(callback)
initializes alert sheet with callback, which to be called when any button clicked on alert sheet. The function “callback” has to take one parameter which is an index of clicked button.
addButtonWithTitle(title)
adds button to alert sheet with specified title
setStyle(style)
sets style of the alert sheet, by default style is automatic, possible values are: "black", "blacktranslucent" and "automatic".
setTitle(title)
sets the title of the alert sheet.
setRedButtonIndex(index)
sets the index of button to be shown as "red button", this button has to have destructive sense and used only when user is going to loose data or application closed, etc.
setBlackButtonIndex(index)
sets the index of button to be shown as "black button" which used as cancel button in most of the dialogs.
Example:
function actionSheetButtonPressed(number)
{
NKAlert("Button pressed", number);
}
function showActionSheet()
{
var sheet = new NKAlertSheet();
sheet.init("actionSheetButtonPressed");
sheet.addButtonWithTitle("ok");
sheet.addButtonWithTitle("no way");
sheet.addButtonWithTitle("I don't know");
sheet.setStyle("black");
sheet.setTitle("Make your choice");
sheet.show();
}

