PDA

View Full Version : how can I set form fields easily



groth
24 Sep 2008, 12:22 AM
hi,
I wanted at some point manipulate the form fields parameter.
and set the fied from the form 'simple' using fields from the from 'modalForm'
right now I amanged to do it this way:


var areaValue = modalForm.findById('hight').getValue() * modalForm.findById('width').getValue();
simple.findById('area').setValue(areaValue);

Is there any more alegant way to do it?
I expected something like


simple.area=modalForm.hight*modalForm.width;


Thanks

evant
24 Sep 2008, 12:26 AM
Well, you could just store a reference to the object:



var o = new Ext.form.NumberField(...);
o.getValue();


Or, give it an id:



{
xtype: 'numberfield',
id: 'foo'
}
//...
Ext.getCmp('foo').getValue();

groth
24 Sep 2008, 12:28 AM
:)