PDA

View Full Version : Ext.form.Checkbox value



martinrame
17 Apr 2012, 7:56 AM
Hi, I have a form with a Checkbox field that I want to save using a store. The checkbox's definition si this:


xtype: 'checkboxfield',
id: 'active',
name: 'active',
fieldLabel: 'Active',
boxLabel: 'Customer is active',
checked: true,
anchor: '100%'

Now, when I get the form's values, I get:


active: "on"

And, when I save the store, the JSON generated changes to "..., "active": false, ...".

How can I define the values true and false instead of "on", to send them in the JSON?.

scottmartin
17 Apr 2012, 8:42 AM
Have a look at inputValues:
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.form.field.Checkbox - See Values section

Regards,
Scott.

martinrame
17 Apr 2012, 9:46 AM
Thanks Scott, setting inputValue to 'true' fixed the issue.