The documentation page for the confirm helper method. Webix Docs

string|functionoptional, the type of a confirm modal box or the callback function callback
functionoptional, the callback function (can be used, if the modal box type is defined as a second parameter)
promisethe Promise object

Example

// basic initialization 
webix.confirm("Test confirm", "confirm-warning")
    .then(function(result){
        webix.message(result);
    })
        .fail(function(){
            webix.message("Cancel");
        });
 
// extended initialization
webix.confirm({
    title: "Close",
    text: "You can't close this window!",
    type:"confirm-error"
})
    .then(function(result){
        webix.message(result);
    })
        .fail(function(){
            webix.message("Cancel");
        });

Related samples

Details

The method can be used in 2 ways:

1. In the Basic form, the method may take the following parameters:

webix.confirm("Test confirm", "confirm-error");

2. In the Extended form, the method takes one parameter - an object with box parameters. The parameters are:

The full list of possible box parameters is given in the related article.

webix.confirm({
    title: "Close",
    text: "You can't close this window!",
    type:"confirm-error"
});

Callbacks

Since webix.confirm() returns a promise, there is no need in a callback functions. However, you can add a callback if this is necessary. As a parameter, the function receives the confirm result status (true or false).

// basic initialization 
webix.confirm("Test confirm", "confirm-warning", function(result){
    webix.message(result);
});
 
// extended initialization
webix.confirm({
    title: "Close",
    text: "You can't close this window!",
    type:"confirm-error",
    callback:function(result){
        webix.message(result);
    }
});

See also

Back to top