RadNotification provides the following client-side events:
-
OnClientShowing—fires just before RadNotification is shown. It can be canceled.
-
OnClientShown—fires after RadNotification is shown
-
OnClientUpdating—fires just before RadNotification content is updated. It can be canceled.
-
OnClientUpdated—fires after RadNotification content is updated
-
OnClientUpdateError—fires if an error was thrown when RadNotification content is updated. An error alert which can be canceled is displayed.
-
OnClientHiding—fires just before RadNotification hides
-
OnClientHidden—fires after RadNotification hides
Note: If a notification menu is configured, it has its own client events, which can be handled as shown in the
Notification Menu demo.
The properties expect the name of a client-side function to be called. When invoked, two arguments are supplied to the function—the sender[the notification itself], and an events argument.
Using the events argument set_cancel method, it is possible to cancel three of the client-side events, namely—OnClientShowing, OnClientUpdating and OnClientHiding. Here is how to do so:
function OnClientShowing(sender, eventArgs)
{
eventArgs.set_cancel(!confirm('Show notification?'));
}