• Publicidad (ayudanos a mantener el Foro haciendo un click sobre la misma)
  • Cuixer, una forma de administrar páginas web que nunca viste!

Ext.ux.Notification

Comparte tus mejoras y extensiones para Ext 2.0.
Avatar de Usuario
Ext.foro.Nuevo
Mensajes: 32
Registrado: 11 Nov 2008, 14:07
Ubicación: El Salvador
NotaPublicado: 20 Abr 2009, 20:08
PLUGINS:
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:
Adjuntos
Ext.ux.Notification.js
(2.37 KiB) 168 veces
[b][color=#0000BF]··¤(`×[¤ ЯØ&ΣЯTØ ¤]×´)¤··[/color][/b]
Para no ver esta publicidad, debes ser usuario del Foro.
Publicidad (ayudanos a mantener el Foro haciendo un click sobre la misma)


Cuixer, una forma de administrar páginas web que nunca viste!

Avatar de Usuario
Ext.foro.Administrador
Mensajes: 1932
Registrado: 07 Mar 2008, 20:45
Ubicación: Argentina
NotaPublicado: 21 Abr 2009, 00:03
Muchísimas gracias por el aporte! :D
Aprender haciendo...
Desarrollo de aplicaciones en ExtJS [CONSULTAR].
Buscar en el foro antes de preguntar y Leer la Documentación.
Imagen
Avatar de Usuario
Ext.foro.Nuevo
Mensajes: 32
Registrado: 11 Nov 2008, 14:07
Ubicación: El Salvador
NotaPublicado: 21 Abr 2009, 10:03
garraS escribió:Muchísimas gracias por el aporte! :D


Para eso estamos para ayudar en lo que se pueda...  :D
[b][color=#0000BF]··¤(`×[¤ ЯØ&ΣЯTØ ¤]×´)¤··[/color][/b]

Volver a Ext 2.0: Extensiones y mejoras





  • Publicidad (ayudanos a mantener el Foro haciendo un click sobre la misma)
  • Cuixer, una forma de administrar páginas web que nunca viste!