Documentation

modalbox

creates a modal box

HTMLElement modalbox(string text,function callback);

Parameters

textstringthe box text
callbackfunctionthe callback function

Returns

HTMLElementthe modal box

See also

Example

webix.modalbox({
        title:"Custom title",
        buttons:["Yes", "No", "Maybe"],
        width:"500px",
        text:"Any html content here"
    });

Details

The method can be used in 2 ways:

  • Basic or short form (contains just the box text - implicit usage of the parameter 'text'. The other parameters take default values).
  • Extended form (contains several available parameters. Non-specified parameters take default values).

Please note, created boxes:

  • Don't prevent the workflow on the application parent window

Extended initialization

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

  • title - (string) the text of the header
  • text - (string) the box text
  • buttons - (array) array of button labels
  • callback - (function) contains a code that will be called when the user clicks on the button. As a parameter takes the button index value as the alert result status.
webix.modalbox({
    title:"Custom title",
    buttons:["Yes", "No", "Maybe"],
    callback: function(result){
        switch(result){
        case 0: 
            //statement
            break;
        case 1:
            //statement
            break;
        ...
        }   
});
Back to top