alert(alertConfigs: Object)
[starting from version: 2.6.5]
This API call shows an alert pop-up window with a custom message.
alertConfigs - the object that describes the alert pop-up. This object has the following properties:
| Property/Type | Description |
|---|---|
| title String | The title of the pop-up. Default value: "".Note: either title or message is required to show the alert pop-up. |
| message String | The message of the pop-up. Default value: "".Note: either title or message is required to show the alert pop-up. |
| type String | optional The type of the pop-up window. Available types: "alert", "confirmation", "error", "info".Default type: "alert". |
| buttons ButtonObject[] | optional By default, theOK button is shown. buttons is used to set custom buttons. Each object in buttons represents one button in the pop-up window. |
| blocking Boolean | optional Defines whether the pop-up is blocking other actions until its button is clicked. Default value: false. |
| Property/Type | Description |
|---|---|
| label String | The label of the button. |
| handler Function | The function that handles clicks on this button. |
Show the pop-up:
pivot.alert({
title: "Error Title",
message: "An error message",
type: "error",
buttons: [{
label: "Button 1",
handler: function() { console.log('Button 1 handler'); }
}, {
label: "Button 2",
handler: function() { console.log('Button 2 handler'); }
}],
blocking: false
});Open the example on JSFiddle.