View Full Version : [CLOSED] Find Notification Dialogs

Feb 27, 2013, 1:14 PM
I have a panel with a various fields. One is a user name with a vCard icon next to it as a button. When I click on the icon I show a Notification dialog with User Information displayed. I defined the following attributes on the notification HideDelay of 5000ms, ShowPin is true, PinEvent = 'clicked'. The user may bring up the notification and click on it, thus pinning the window. The notification is not modal.

My question is how can I find all the notification windows and close them via code? The reason is if the user pinned the notification window and then clicks somewhere else in the application I need to close the notification because it will have nothing to do with other parts of the system.

One easy fix would be to make the notification modal.

Feb 27, 2013, 2:58 PM
You can find all notifications windwows via

Ext.ComponentQuery.query("window[cls~=' x-notification']")

Feb 27, 2013, 4:20 PM
Is there an equivalent for behind code?

Feb 27, 2013, 4:36 PM
No, notifications are absent on the server side. Do you need all notifications or particular only?
You can always to set ID to notification and use GetCmp to destroy it from code behind


Feb 28, 2013, 2:08 PM
I just need a particular notification window based on ID. So the following code works when the notification exists:


But how can I test if X.GetCmp<Window>("Notification1") exists before trying to close it? Otherwise the code hangs.

Feb 28, 2013, 2:16 PM
Just create javascript code

function closeNotification(id)
var cmp = Ext.getCmp(id);
if (cmp) {

and call on the server side

X.Js.Call("closeNotification", "Notification1");

Feb 28, 2013, 3:04 PM
Perfect, thanks for the solution. Please close the thread.