I have a simple ExtJS form, but I would like to add additional attributes to be sent as post data.
I have tried form.setValues({name:value}) but for some reason it does not actually set the value...
Thanks
The documentation for setValues says:
Set values for fields in this form in bulk.
From that I take it that the fields have to exist in the form for the values to be set, so add hidden fields to the form. http://dev.sencha.com/deploy/dev/docs/?class=Ext.form.Hidden
You can do that in your FormPanel config or using formPanel.add
[{
xtype: 'hidden',
name: 'hidden1',
value: 'hiddenValue1'
}, {
xtype: 'hidden',
name: 'hidden2',
value: 'hiddenValue2'
}]
If you need to set the values dynamically, you can now use form.setValues.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With