1. #1
    Sencha User
    Join Date
    Jun 2010
    Location
    France
    Posts
    44
    Answers
    2
    Vote Rating
    0
    ludm is on a distinguished road

      0  

    Default Unanswered: Problem with destroy an create again

    Unanswered: Problem with destroy an create again


    Hello,

    I have a view called Cave_V,
    When I press a button, it creates the view and then I have a button in this view to close it. I want to destroy it for memory usage, but I need to create again later.

    Problem
    Then I Create again, the controller doesn't work, I don't understand why.

    Here is the controller
    Code:
    Ext.define('Cave.controller.Main_C', {
        extend: 'Ext.app.Controller',
    
    
        config: {
            refs: {
                ajouterButton: "#Ajouter",
                fermerCaveBut: "#fermerCaveB",
                CaveV: "#Cave1",
                Casier:"#Casier1",
            },
            control: {
                 ajouterButton: {
                             tap: 'afficheCave'
                },
            fermerCaveBut: {
                             tap: 'fermerCave'
                },
            },
        },
    
    
        afficheCave: function() {
           // instanciation de la cave
            var maCave= Ext.create('Cave.view.Cave_V');
            maCave.afficher();
            monCasier=this.getCasier();
            monCasier.remplir();
        },
        fermerCave: function() {
            var maCave=this.getCaveV();
            maCave.fermer();
            console.log("fermer");
        }
    });
    Here are the two function called :

    afficher:function(){

    Ext.Viewport.add(this);
    this.show();
    },
    fermer:function(){
    this.destroy();
    }
    What is wrong ?

  2. #2
    Sencha User jerome76's Avatar
    Join Date
    Apr 2012
    Location
    New Jersey
    Posts
    1,149
    Answers
    132
    Vote Rating
    99
    jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice

      0  

    Default


    So you Ext.create(...); the view after destroying it? All I see is that you use add(this)​ and this.show()

  3. #3
    Sencha User
    Join Date
    Jun 2010
    Location
    France
    Posts
    44
    Answers
    2
    Vote Rating
    0
    ludm is on a distinguished road

      0  

    Default


    Yes there is :

    Code:
    var maCave= Ext.create('Cave.view.Cave_V');
    (in the controller)

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..."