modalbox of common helpers, Methods Webix Docs

string|functionoptional, the type of a 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.modalbox("Custom title","alert-error");
 
// extended initialization
webix.modalbox({
    title:"Custom title",
    buttons:["Yes", "No", "Maybe"],
    width:500,
    text:"Any HTML content here"
})
    .then(function(result){
        webix.message(result);
    });

Related samples

Details

The method can be used in 2 main ways:

1. Basic form contains several parameters:

webix.modalbox("Custom title","alert-error");

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

webix.modalbox({
    title:"Title",
    buttons:["Yes", "No", "Maybe"],
    text:"Some text",
    width:500
});

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

Callbacks

If you really need to, you can also add a callback function. Callback also receives the ID of the button that was clicked.

webix.modalbox({
    title:"Custom title",
    buttons:["Yes", "No", "Maybe"],
    width:500,
    text:"Any HTML content here",
    callback:function(result){
        webix.message(result);
    }
});

See also

Back to top