1. #1
    Ext User Davi Baldin's Avatar
    Join Date
    Jul 2007
    Location
    Campinas, S
    Posts
    25
    Vote Rating
    0
    Davi Baldin is on a distinguished road

      0  

    Thumbs up [TIP] Destroy form every time !

    [TIP] Destroy form every time !


    In specific context, i need to reder dynamic form with diferents fields. So with this code, i recreate without problem the form every time...

    this code worksforme:

    Code:
    createForm : function(paramType,paramList) {
    			if(form) {
    				Ext.get('paramForm').remove();
    				form = null;
    			}
    			
    			form = new Ext.form.Form({id: 'paramForm'});
    and the object

    Code:
    ParametersEditorDialog = function(){
    	
    	var form;
    	var dialog;
    	
    	return {
    		createForm : function(paramType,paramList) {
    			if(form) {
    				Ext.get('paramForm').remove();
    				form = null;
    			}
    			
    			form = new Ext.form.Form({id: 'paramForm'});
    			
    			form.add(
            		new Ext.form.TextField({
                			fieldLabel: paramType,
                			name: 'first',
                			width:175,
                			allowBlank:false,
    				id: 'f1'
            		}));
    			
    			//Render
    			form.render('parameters-dialog-form');
    		}
    		//... cuted here
    	};
    //Function end
    }();
    thats is !!!

    Davi
    Last edited by Davi Baldin; 21 Jul 2007 at 4:18 PM. Reason: grammar error

  2. #2
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,353
    Vote Rating
    79
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    Yeah, once a form is rendered you do have to destroy it other wise you can't add things to it dynamically ,etc.

  3. #3
    Sencha User
    Join Date
    Mar 2007
    Posts
    210
    Vote Rating
    1
    KRavEN is on a distinguished road

      0  

    Default


    To avoid giving the form an id, which I don't like doing:

    PHP Code:
          if (form) {
            
    form.el.remove();
            
    form null;
          }; 

Thread Participants: 2

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..." hd porno faketaxi