Threaded View

  1. #1
    Ext User efattal's Avatar
    Join Date
    Dec 2007
    Posts
    21
    Vote Rating
    0
    efattal is on a distinguished road

      0  

    Post Ext.ux.Notification

    Ext.ux.Notification


    UPDATE 09.16.2008 : TOASTWINDOW IS DEAD. NOTIFICATION IS ALIVE.
    I took in account your different contributions, especially that of jmcneese. I adopted the new name Ext.ux.Notification that seems more compliant to Ext spirit. I brought some corrections.

    Enhancement: when you click on the notification window, it sticks and the close button shows up.

    It seems to be OK in my different browsers.

    Thanks a lot.

    The attached source code (and the online demo) includes a sound effect when the window ejects.

    Old post:
    Here is a small extension that displays unobstrusive message sliding windows like those in Outlook.

    Demo: http://www.efattal.fr/extjs-dev/examples/toastwindow/

    CSS:
    Code:
    .error{background-image:url(../images/icons/gif/exclamation.gif);}
    .information{background-image:url(../images/icons/gif/information.gif) ! important;}
    PHP Code:
    Ext.ux.ToastWindowMgr = {
        
    positions: [] 
    };

    Ext.ux.ToastWindow Ext.extend(Ext.Window, {
        
    initComponent: function(){
              
    Ext.apply(this, {
                  
    iconClsthis.iconCls || 'information',
                
    width200,
                
    height100,
                
    autoScrolltrue,
                
    autoDestroytrue,
                
    plainfalse
              
    });
            
    this.task = new Ext.util.DelayedTask(this.hidethis);
            
    Ext.ux.ToastWindow.superclass.initComponent.call(this);
        },
        
    setMessage: function(msg){
            
    this.body.update(msg);
        },
        
    setTitle: function(titleiconCls){
            
    Ext.ux.ToastWindow.superclass.setTitle.call(thistitleiconCls||this.iconCls);
        },
        
    onRender:function(ctposition) {
            
    Ext.ux.ToastWindow.superclass.onRender.call(thisctposition);
        },
        
    onDestroy: function(){
            
    Ext.ux.ToastWindowMgr.positions.remove(this.pos);
            
    Ext.ux.ToastWindow.superclass.onDestroy.call(this);
        },
        
    afterShow: function(){
            
    Ext.ux.ToastWindow.superclass.afterShow.call(this);
            
    this.on('move', function(){
                   
    Ext.ux.ToastWindowMgr.positions.remove(this.pos);
                
    this.task.cancel();}
            , 
    this);
            
    this.task.delay(2000);
        },
        
    animShow: function(){
            
    this.pos 0;
            while(
    Ext.ux.ToastWindowMgr.positions.indexOf(this.pos)>-1)
                
    this.pos++;
            
    Ext.ux.ToastWindowMgr.positions.push(this.pos);
            
    this.setSize(200,100);
            
    this.el.alignTo(document"br-br", [ -20, -20-((this.getSize().height+10)*this.pos) ]);
            
    this.el.slideIn('b', {
                
    duration1,
                
    callbackthis.afterShow,
                
    scopethis
            
    });    
        },
        
    animHide: function(){
               
    Ext.ux.ToastWindowMgr.positions.remove(this.pos);
            
    this.el.ghost("b", {
                
    duration1,
                
    removetrue,
            
    scopethis,
            
    callbackthis.destroy
            
    });    
        }
    }); 
    Usage:

    PHP Code:
    new Ext.ux.ToastWindow({
        
    title'My title',
        
    html'My Message',
        
    iconCls'error'
    }).show(document); 
    May this code be useful to someone.
    Attached Images
    Attached Files
    Last edited by efattal; 17 Nov 2008 at 9:35 AM. Reason: Bug corrected

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar