Dialog.OkButtonClicked

Syntax

OkButtonClicked: function (sender, args);

Parameters

sender. Event source.

args. Event information. Available arguments: DialogResult - settings selected in the dialog box by the user, IsCancelClose - it determines that the dialog box does not close on clicking the OK button (if the value is True).

Description

The OkButtonClicked event is fired on clicking the OK button.

Example

To execute the example, the HTML page must contain the FontDialog component named fontdialog (see Example of Creating the FontDialog Component). Adds the OKButtonClicked event handler:

fontdialog.OkButtonClicked.add(function (sender, args) {
    // Get settings selected in the dialog box by the user
    var font = sender.getDialogResult();
    console.log("Font family: " + font.getFontFamily());
    console.log("Font size: " + font.getSize());
    // Do not close the dialog box after clicking the OK button
    args.IsCancelClose = true;
});

After executing the example on clicking the OK button in the dialog box the browser console shows name and size of the user-defined font:

Font family: Tahoma
Font size: 12

The dialog box does not close.

See also:

Dialog