creates a modal box
text | string|object | mandatory, the box text as a string, or the box configuration object |
type | string|function | optional, the type of a modal box or the callback function |
callback | function | optional, the callback function (can be used, if the modal box type is defined as a second parameter) |
promise | the Promise object |
// 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);
});
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.
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);
}
});