confirm
creates a confirm box
HTMLElement confirm(string text,function callback);
Parameters
text | string | the box text |
callback | function | the callback function |
Returns
HTMLElement | the confirm box |
See also
Example
webix.confirm("Test confirm", function(result){
webix.confirm({
title:"Custom title",
ok:"Yes",
cancel:"No",
text:"Result: "+result,
});
});
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:
- Not modal (don't prevent the workflow on the application parent window).
- Exist in the only copy (when a new window appears - the previous one disappears).
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
- ok - (string) the text of the 'Ok' button
- cancel - (string) the text of the 'Cancel' button
- type - ('confirm-warning' or 'confirm-error') the confirm type: warning or error
- callback - (function) contains a code that will be called when the user clicks on the button. As a parameter takes the true/false value - the alert result status
webix.alert({
title: "Close",
text: "You can't close this window!",
type:"confirm-error"
})
Back to top