-
5 Apr 2012 10:26 AM #61
Hi,
I'm having problems with running this extension under Ext 4.1.0.RC2. Basically, I have a button which shows and hides notification, where notification is instantiated on first show and reused later for consecutive show() calls. On first notification.show(), everything is ok, but on every consecutive show(), I'm getting -10000 from a call me.getXposAlignedToManager() in beforeShow handler.
I was able to getting it work again (at least for my case) with following modification:
Does anybody else experience same problems with 4.1.0.RC2? TnxCode:beforeShow: function() { var me = this; // ... me.xPosOld = me.xPos; if (notifications.length) { me.el.alignTo(notifications[notifications.length - 1].el, me.siblingAlignment, [0, 0]); me.xPos = me.getXposAlignedToSibling(notifications[notifications.length - 1]); me.yPos = me.getYposAlignedToSibling(notifications[notifications.length - 1]); } else { me.el.alignTo(me.manager.el, me.managerAlignment, [(me.paddingX * me.paddingFactorX), (me.paddingY * me.paddingFactorY)]); me.xPos = me.getXposAlignedToManager(); me.yPos = me.getYposAlignedToManager(); } if (me.xPos === -10000) { me.xPos = me.xPosOld; } // ... }
Best regards,
Damir Murat
-
6 Apr 2012 8:56 AM #62
As it turns out, 4.1.0-rc2 changed visibility mode to 'offsets' for Window class. For restoring correct behavior of Notification, I just set hideMode to 'visibility' in Notification's definition:
After that, Notification's behavior is restored to normal, as it was before 4.1.0-rc2.Code:Ext.define('Ext.ux.window.Notification', { extend: 'Ext.window.Window', alias: 'widget.uxNotification', hideMode: 'visibility', cls: 'ux-notification-window', //... });
Damir Murat
-
17 Apr 2012 7:52 PM #63
base on Ext js 3.*?
base on Ext js 3.*?
do u hava this extension base on Extjs 3.*? i try to rewrite this on 3.* ,bug it looks like difficult
-
19 Apr 2012 7:09 AM #64
Yes. Efattal has authored a 3.x Notification extension:
http://www.sencha.com/forum/showthre...x.Notification
This was the inspiration for the 4.x version.
-
21 May 2012 6:24 AM #65
Did you ever figure out how to destroy the notifications after hiding? I'm going to be creating a lot of notifications, I don't want all of the old ones eating up memory once they are hidden.
-
21 May 2012 11:18 AM #66
-
22 May 2012 12:17 AM #67
@dcohn: If I look at the code, the beforehide listener call the destroy. The destroy animate the notification (make it disappear) and then afteranimate call the parent destroy.
So when notification is hidden, it's destroyed.
-
22 May 2012 5:33 AM #68
I think that you're wrong, look at the dom, markup is still there!
My fix for this, in afteranimate listener add me.destroy at the end:
PHP Code:afteranimate: function () {
if (me.manager) {
var notifications = me.getNotifications(me.managerAlignment);
var index = Ext.Array.indexOf(notifications, me);
if (index != -1) {
Ext.Array.erase(notifications, index, 1);
// Slide "down" all notifications "above" the hidden one
for (;index < notifications.length; index++) {
notifications[index].slideBack();
}
}
}
me.readyToHide = true;
// 2012-05-22 By Ing. Leonardo D'Onofrio (leonardo_donofrio at hotmail.com)
me.destroy();
// end
}
Last edited by ldonofrio; 22 May 2012 at 5:47 AM. Reason: fix
-
22 May 2012 6:45 AM #69
I look the code in my app see that I use the version 1.3 of Notification. I haven't seen that a 2.0 version exist.
You're right in the new version the call to destroy is not present.
But they are other changes, and I think the call to destroy must not be in afteranimate but a few lines lower. Like this when animation ended, Ext.Window (parent of Notification) hide() is called, beforehide and hide event are fired and then Notification is destroyed.
PHP Code:me.readyToHide = true;
me.hide();
}
}
});
}
// Calling parents hide function to complete hiding
if (me.readyToHide) {
me.isHiding = false;
me.readyToHide = false;
me.removeCls('notification-fixed');
this.callParent(arguments);
//hpsam: call to destroy after all hide actions are done.
me.destroy();
}
-
12 Aug 2012 7:40 PM #70
hpsam, dmurat, idonofrio:
I have sorted out the problem with destruction and reuse. The notifications now destroy their dom by default unless closeAction is set to 'hide' in which case the notification never destroys and will allow for repeated update() and show() calls.
I also updated the demo with an example of reuse.


Reply With Quote
