-
19 Oct 2010 11:51 PM #1
form.getValues - this.el is undefined
form.getValues - this.el is undefined
I have a Window
I need to get all the values of the fields.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 } ] } ] } ] } ] } ] })
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
-
20 Oct 2010 12:05 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 40
You can only call getValues() after the form has rendered.
ps. Calling getFieldValues() should be possible before the form is rendered.
-
20 Oct 2010 12:29 AM #3
Excellent, working. Thanks, you saved my life!
-
20 Oct 2010 1:10 AM #4
Why did not he finds startDate? The form of the above.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.
-
20 Oct 2010 2:31 AM #5Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 40
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.
-
20 Oct 2010 3:57 AM #6
-
20 Oct 2010 2:10 PM #7Sencha - Community Support Team
- Join Date
- Jan 2009
- Location
- Palo Alto, California
- Posts
- 1,941
- Vote Rating
- 6
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
-
20 Oct 2010 2:20 PM #8
nice to hear, form handling is very tricky but shouldn't.
vg Steffen
--------------------------------------
Release Manager of TYPO3 4.5
energlobe.de - german online magazine
-
20 Oct 2010 2:24 PM #9Sencha - Community Support Team
- Join Date
- Jan 2009
- Location
- Palo Alto, California
- Posts
- 1,941
- Vote Rating
- 6
Ext JS Senior Software Architect
Personal Blog: http://edspencer.net
Twitter: http://twitter.com/edspencer
Github: http://github.com/edspencer
-
20 Oct 2010 11:55 PM #10
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
energlobe.de - german online magazine
Similar Threads
-
this.el undefined when using getvalues()
By Nytrm in forum Ext 3.x: Help & DiscussionReplies: 0Last Post: 23 Apr 2010, 2:50 AM -
Ext.form.BasicForm.getValues() returns object if form is empty
By mrutz in forum Ext 3.x: Help & DiscussionReplies: 0Last Post: 22 Dec 2009, 2:31 AM -
BasicForm.getValues() returns undefined!
By super_drone in forum Ext 3.x: Help & DiscussionReplies: 2Last Post: 9 Nov 2009, 1:41 PM -
bug Ext.form.CheckBoxField and form.getValues()
By mdissel in forum Ext 1.x: BugsReplies: 5Last Post: 27 Feb 2008, 1:31 PM -
ComboBox and Ext.form.Form.getValues bug ?
By marvinhorst in forum Ext 1.x: Help & DiscussionReplies: 2Last Post: 13 May 2007, 3:38 PM


Reply With Quote