Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: form.getValues - this.el is undefined

  1. #1
    Sencha User
    Join Date
    Sep 2010
    Posts
    58
    Vote Rating
    0
      0  

    Default form.getValues - this.el is undefined

    I have a Window
    Code:
    		new Ext.Window({
    		    title: 'My Window',
    		    closeAction: 'hide',
    		    width: 662,
    		    height: 403,
    		    layout: 'anchor',
    		    boxMinWidth: 662,
    			items: [
    				{
    					xtype: 'form',
    					id: 'form-description-activity',
    					name: 'form-description-activity',
    					frame: true,
    					items: [
    						{
    							xtype: 'fieldset',
    							title: '???????? ??????????',
    							layout: 'hbox',
    							width: 634,
    							layoutConfig: {
    
    							},
    							items: [
    								{
    									xtype: 'container',
    									layout: 'form',
    									width: 300,
    									items: [
    										{
    											xtype: 'textfield',
    											id: 'name',
    											name: 'name',
    											fieldLabel: '????????????',
    											anchor: '100%'
    										},
    										{
    											xtype: 'compositefield',
    											fieldLabel: '?????? ???????',
    											anchor: '100%',
    											items: [
    												{
    													xtype: 'combo',
    													id: 'startCycle',
    													name: 'startCycle',
    													flex: 1
    												},
    												{
    													xtype: 'datefield',
    													id: 'startDate',
    													name: 'startDate',
    													format: 'd.m.Y',
    													flex: 1
    												}
    											]
    										}
    									]
    								}
    							]
    						}
    					]
    				}
    				]
    	})
    I need to get all the values of the fields.

    My code is
    var values = Ext.getCmp('form-description-activity').getForm().getValues();
    and i get "this.el is undefined"
    If I comment this line, the form is displayed correctly. What's wrong? Thanks.

    use ExtJS 3.2.1

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    119
      0  

    Default

    You can only call getValues() after the form has rendered.

    ps. Calling getFieldValues() should be possible before the form is rendered.

  3. #3
    Sencha User
    Join Date
    Sep 2010
    Posts
    58
    Vote Rating
    0
      0  

    Default

    Excellent, working. Thanks, you saved my life!

  4. #4
    Sencha User
    Join Date
    Sep 2010
    Posts
    58
    Vote Rating
    0
      0  

    Default

    Code:
    var form = Ext.getCmp('form-description-activity').getForm();
    form.findField('name').setValue(record.name); // it's worked
    form.findField('startDate').setValue(record.startDate) // form.findField('startDate') is null.
    Why did not he finds startDate? The form of the above.

  5. #5
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    119
      0  

    Default

    CompositeField is not a container, so it can't find fields inside it (this is currently listed as a bug).

    I recommend using a hbox container instead of a CompositeField.

  6. #6
    Sencha User
    Join Date
    Sep 2010
    Posts
    58
    Vote Rating
    0
      0  

    Default

    OK. Thanks.

  7. #7
    Sencha User edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    11
      0  

    Default

    I'm painfully aware of this issue in Ext JS 3.x - we're changing things in Ext JS 4.x so that you no longer have to render a form before interacting with its data. CompositeField will also go away as it will no longer be necessary to achieve more advanced form layouts.
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

  8. #8
    Sencha Premium Member steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,676
    Vote Rating
    9
      0  

    Default

    nice to hear, form handling is very tricky but shouldn't.
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  9. #9
    Sencha User edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    11
      0  

    Default

    Quote Originally Posted by steffenk View Post
    nice to hear, form handling is very tricky but shouldn't.
    I feel your pain. We have a great solution coming in 4
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

  10. #10
    Sencha Premium Member steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,676
    Vote Rating
    9
      0  

    Default

    is it the same like the approach in sencha touch?

    Btw - yesterday i saw your talk (http://pivotallabs.com/talks/109-sencha-touch) - very nice! I have to start with touch to be ready
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

Page 1 of 2 12 LastLast

Similar Threads

  1. this.el undefined when using getvalues()
    By Nytrm in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 23 Apr 2010, 2:50 AM
  2. Ext.form.BasicForm.getValues() returns object if form is empty
    By mrutz in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 22 Dec 2009, 2:31 AM
  3. BasicForm.getValues() returns undefined!
    By super_drone in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 9 Nov 2009, 1:41 PM
  4. bug Ext.form.CheckBoxField and form.getValues()
    By mdissel in forum Ext 1.x: Bugs
    Replies: 5
    Last Post: 27 Feb 2008, 1:31 PM
  5. ComboBox and Ext.form.Form.getValues bug ?
    By marvinhorst in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 13 May 2007, 3:38 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •