Search
Dialogs.showConfirmDialog Method
See Also
 






Shows a confirm dialog, which displays a message and OK and Cancel buttons.

Namespace: MindFusion.Common.UI
File: Dialogs.js

 Syntax

JavaScript  Copy Code

function showConfirmDialog ([title, [message, [callback, [parentElement, [theme]]]]])

 Parameters

title
Optional.

String. The text to display as a dialog title.

message
Optional.

String. The message to display as the dialog text.

callback
Optional.

function. The callback function to invoke when the dialog is closed.The dialog's modalResult will be passed as a parameter to the callback function.

parentElement
Optional.

HTMLElement. The Dom element to append the dialog to.If the parameter is not specified, the dialog will be appended to document.body.

theme
Optional.

String. The theme of the dialog.

 Example

The following code creates a confim dialog:

JavaScript  Copy Code

// show the dialog
ui.Dialogs.showConfirmDialog("Elapsed Time" "Do you want to continue?", warnUser, document.getElementById("content"), "standard");


function warnUser(result, elapsedTime)
{
 if (result == ui.ModalResult.Cancel) return;

  
 alert("You have played this game for " + elapsedTime + "minutes!);
 
}

 See Also