Hybrid View

  1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    40
    Vote Rating
    0
    Gery is on a distinguished road

      0  

    Default ext.window close automatically... is it possible in extjs 3.4??

    ext.window close automatically... is it possible in extjs 3.4??


    Hello Experts

    I was wondering if it is possible to close automatically an ext.window, if so, I'd appreciate your suggestions to do this. I have this code:

    Code:
    welcomeWin = new Ext.Window(
                                            {
                                                    border: false,
                                                    resizable: false,
                                                    draggable: false,
                                                    closable: false,
                                                    layout: 'fit',
                                                    autoWidth: true,
                                                    autoHeight: true,
                                                    items: [welcomePanel]
                                            }
                                            );
    this window appears after pressing a button and would like that it closes automatically after 10 seconds for example. Is that possible? please let me know.

    Best regards,

    Gery

  2. #2
    Sencha User
    Join Date
    Dec 2011
    Posts
    20
    Vote Rating
    2
    jennifer123 is on a distinguished road

      0  

    Default


    Code:
    var mywindow=new Ext.Window({
        title:'My Window Title',
        items:someitems,
        width:500,
        height:300,
        autoScroll:true,
        listeners:{
            show: function() {
                setTimeout("mywindow.close()", 10*1000);
            }
        }
    })

  3. #3
    Sencha User
    Join Date
    Jun 2012
    Posts
    40
    Vote Rating
    0
    Gery is on a distinguished road

      0  

    Default


    Thanks Jennifer123 for the code but the window is still there, this is my code:

    Code:
    var action = new Ext.Action(
            {
                    handler: function()
                    {
                            if (this.pressed)
                            {
                                    if (!this.printpanelWin)
                                    {
                                            this.printpanelWin = new Ext.Window(
                                            {
                                                    border: false,
                                                    resizable: false,
                                                    draggable: false,
                                                    closable: false,
                                                    layout: 'fit',
                                                    autoWidth: true,
                                                    autoHeight: true,
                                                    x: 141,
                                                    y: 28,
                                                    items: [printPanel],
    listeners:{         show: function() {             setTimeout("mywindow.close()", 10*1000);         }     }
                                            }
                                            );
                                    }
                                    this.printpanelWin.show();
                            }
                            else
                            {
                                    this.printpanelWin.hide();
                            }
                    },
    }
    );
    what it actually does is basically triggering the printPanel after pressing the button. Using the listener it should close the window after 10 seconds, I'm almost sure it is in the wrong position, but I put it inside the () in the this.printpanelWin.show(); and didn't work either.

    Any support is appreciated.

    Best regards,

  4. #4
    Sencha User
    Join Date
    Dec 2011
    Posts
    20
    Vote Rating
    2
    jennifer123 is on a distinguished road

      0  

    Default


    Well it works for me. Can you try the following
    1. I see this.printpanelWin.hide(), try replacing close() with hide() or destroy(). (I hope you changed mywindow to this.printpanelWin )
    2. If the window still does not close, replace this.printpanelWin.close() with alert(1) and see if you see the alert message after 10 seconds.
    Let me know what above steps result into.

  5. #5
    Sencha User
    Join Date
    Jun 2012
    Posts
    40
    Vote Rating
    0
    Gery is on a distinguished road

      0  

    Default


    lapsus brutus... thanks for pointing that out Jennifer, I forgot to replace the mywindow.close, but still it is not working, this is what I tried recently:

    Code:
    var printpanelWin = null;
    
            action = new Ext.Action(
            {
                    handler: function()
                    {
                            if (this.pressed)
                            {
                                    if (!this.printpanelWin)
                                    {
                                            this.printpanelWin = new Ext.Window(
                                            {
                                                    border: false,
                                                    resizable: false,
                                                    draggable: false,
                                                    closable: false,
                                                    layout: 'fit',
                                                    autoWidth: true,
                                                    autoHeight: true,
                                                    x: 141,
                                                    y: 28,
                                                    items: [printPanel],
                                                    listeners:{show: function() {setTimeout("this.printpanelWin.destroy()", 10*1000);}}
                                            }
                                            );
                                    }
                                    this.printpanelWin.show();
                            }
                            else
                            {
                                    this.printpanelWin.hide();
                            }
                    }
    });
    when I used this.printpanelWin.alert(1), it appeared this error in firebug: "this.printpanelWin is undefined", this appears exactly after 10 seconds , the same if I delete "this", so it's working! it's definitely getting somewhere , thanks Jennifer for your nice support and neat mood

  6. #6
    Sencha User
    Join Date
    Dec 2011
    Posts
    20
    Vote Rating
    2
    jennifer123 is on a distinguished road

      0  

    Default


    If the code was setTimeout("alert(1)",..., then it would have worked fine without the error. However, since the error happened after 10 seconds that means that setTimeout is working. It's just a matter of closing the window now.

    I am not sure but maybe using 'this' is causing the issue. When I tried it with 'this' it gave me an error 'this.mywindow is undefined'. Is it possible for you to remove 'this.' from your window name? Let me know

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."