- Código: Seleccionar todo
/*
new Ext.ux.Notification({
iconCls: 'x-icon-error',
title: 'Ruh-row',
html: 'This is just a stub. This is only a stub. If this would have been a real functioning doo-dad, you never would have even seen this stub.',
autoDestroy: true,
hideDelay: 5000
}).show(document);
*/
Ext.ux.NotificationMgr = {
positions: []
};
Ext.ux.Notification = Ext.extend(Ext.Window, {
initComponent: function(){
Ext.apply(this, {
closable: true,
iconCls: this.iconCls || 'x-icon-information',
width: 200,
//height: 100,
autoHeight: true,
autoScroll: true,
autoDestroy: true,
draggable: false,
plain: false
});
this.task = new Ext.util.DelayedTask(this.hide, this);
Ext.ux.Notification.superclass.initComponent.call(this);
},
setMessage: function(msg){
this.body.update(msg);
},
setTitle: function(title, iconCls){
Ext.ux.Notification.superclass.setTitle.call(this, title, iconCls||this.iconCls);
},
onRender:function(ct, position) {
Ext.ux.Notification.superclass.onRender.call(this, ct, position);
},
onDestroy: function(){
Ext.ux.NotificationMgr.positions.remove(this.pos);
Ext.ux.Notification.superclass.onDestroy.call(this);
},
afterShow: function(){
Ext.ux.Notification.superclass.afterShow.call(this);
this.on('move', function(){
Ext.ux.NotificationMgr.positions.remove(this.pos);
this.task.cancel();}
, this); this.task.delay(4000);
},
animShow: function(){
this.pos = 0;
while(Ext.ux.NotificationMgr.positions.indexOf(this.pos)>-1)
this.pos++;
Ext.ux.NotificationMgr.positions.push(this.pos);
this.setSize(200,100);
this.el.alignTo(this.animateTarget || document, "br-br", [ -4, -34-((this.getSize().height+10)*this.pos) ]);
this.el.slideIn('b', {
duration: 1,
callback: this.afterShow,
scope: this
});
},
animHide: function(){
Ext.ux.NotificationMgr.positions.remove(this.pos);
this.el.ghost("b", {
duration: 1,
remove: true,
scope: this,
callback: this.destroy
});
}
});
Ejemplo de su uso:
- Código: Seleccionar todo
function probando(){
new Ext.ux.Notification({
autoDestroy:true, hideDelay:6000, iconCls:'ico-god4',
title:'".(MSGTT0004)."', html:(setBodyNoty('','".MSMATE0002."'))
}).show(document);
}
y como queda es asi:


