Example success type message from CLAPI (notification non-modal):
akioma.swat.Message.message({ title: "Success", type: "success", text: "Information was saved", expire: 5000 });
Example modal default OK button
akioma.swat.Message.message({ type: "success", text:"Information was saved", modal: true});
Example (modal custom buttons from array)
akioma.swat.Message.message({ type: "success", text:"Are you sure?", modal: true, buttons: ['Yes','No']});
Example Smart Message from Backend
akioma.swat.Message.displayMessageNum("MSGGROUP", 56, { type: 'confirm', // the type is coming also from the back-end, but it can be overwritten closeOnEsc: false, closeOnClickOutside: false, modal: true // if not specified, it will use the defaults for the message type })
Example with custom buttons and callback support:
akioma.swat.Message.message({ type: "success", text:"One of 10 excel files was uploaded successfully.", modal: true, buttons: ["Continue", "Stop"], callback: (val) => { console.log(val); } }); /* in the above example, if you click on the Continue button, it will return NULL, if you click on the Stop button, it will return True !!! We recommend to use the example from below, to define the full behaviour of the buttons and the values returned by each button on click !!! */?? akioma.swat.Message.message({ type: "success", text:"Are you sure?", modal: true, buttons: { replyyes: { text: "Yes", value: "yes was pressed", visible: true, className: "", closeModal: true, }, replyno: { text: "No", value: "no was pressed", visible: true, className: "", closeModal: true } }, callback: function(val){ console.log(val); }}); ?? akioma.swat.Message.message({ type : "info", closeOnEsc: false, // default is set to TRUE closeOnClickOutside: false, // default is set to FALSE text : 'Some random text here', modal : true });