Panel messages are messages displayed on the panel level. You can add, remove messages to any panel level object(forms, grids, scheduler, treegrids...) from CLAPI.
Panel messages are available since version 20.04 of the SWAT framework.
Standard types of messages
Type | Color |
---|---|
success | green |
info | blue |
warning | orange |
error | red |
There is no default type. A message with no type would not be displayed. |
Panel Messages Attributes:
Attribute | Type | Info | Default value |
---|---|---|---|
text | string | The text that would be displayed in the panel message. | none |
type | string | Available values: info, success, warning, error | none |
Both attributes are required! |
Panel Messages Styling:
The scss variables for colors are the same with Smart Messages
.panel-msg:empty { display: none; } .panel-msg { padding: 20px 0px 20px 45px; p { margin: 2px 0px; font-family: $light_font; } } .msg-error { color: $msg_error_color; } .msg-warning { color: $msg_warning_color; } .msg-info { color: $msg_info_color; } .msg-success { color: $msg_success_color; } |
Panel Messages Examples:
akioma.swat.form.addPanelMessage({ text: 'An info message', type: 'info' }) |
akioma.swat.form.addPanelMessage({ text: '{{selfno}} is not unique. Try again', type: 'error' }) |
akioma.swat.form.removePanelMessage(0) |
akioma.swat.form.clearPanelMessage() |
akioma.swat.grid.addPanelMessage({ text: 'Currency is {{currencydesc}}', type: 'warning' }) |
akioma.swat.grid.addPanelMessage({ text: 'Customer is set to {{customerdesc}}', type: 'success' }) ?? |
akioma.swat.window.addWindowMessage({ text: 'An window message', type: 'success' }) |
akioma.swat.window.addWindowMessage({ text: 'Something went wrong', type: 'warning' }) |
akioma.swat.window.clearWindowMessage() |
akioma.swat.dataview.addPanelMessage({ text: 'Info message', type: 'info' }) |