1. #1
    Ext User
    Join Date
    Aug 2007
    Posts
    23
    Vote Rating
    0
    ssa962 is on a distinguished road

      0  

    Default Config object problem

    Config object problem


    I have created a config object for my FormPanel as shown below-

    Code:
    var myFormConfig = {
    	bodyStyle:'padding:25px 0px 0px 10px',
    	url: 'saveform.php',
    	items: [{
    		layout: 'form',
    		border: false,
    		defaultType: 'textfield',
    		items: [{
    			fieldLabel: 'Name',
    			name: 'name',
    			allowBlank: false,
    			anchor:'80%'
    		}]
    	}]
    };
    And now I use it to create a FormPanel -

    Code:
    var myForm1 = new Ext.FormPanel(myFormConfig);
    Everything is fine so far until I try to create another FormPanel with a "save" button, like the following -

    Code:
    var myForm2 = new Ext.FormPanel(
    	{
    	myFormConfig,
    	buttons: [{
    		text: 'Save',
    	}]
    	}
    );
    Maybe this is not the way to add buttons to the form. I am just wondering if there is any way to do this. I don't want both the forms to have save button, the second form should have the save button.

    Any help is highly appreciated.

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,498
    Vote Rating
    47
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    That's just not javascript.

    A configuration object must be an object.

    An object is a list of name: value pairs between "{" and "}".

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,498
    Vote Rating
    47
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Read up about Ext.apply

  4. #4
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    or look at using a factory (discussed in the wiki).

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