Results 1 to 3 of 3

Thread: 'value' config does not work for Ext.form.field.Checkbox

    You found a bug! We've classified it as EXTJS-9969 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1

    Default 'value' config does not work for Ext.form.field.Checkbox

    Ext version tested:
    • Ext 4.2.0
    Browser versions tested against:
    • ALL Browsers
    • 'value' config does not work
    Steps to reproduce the problem:
    • Create an Ext.form.field.Checkbox and try to set 'value' config
    The result that was expected:
    • field should be initialized by 'value' config
    The result that occurs instead:

    • field is not initialized by 'value' config
    Test Case:
        Ext.onReady(function() {
                Ext.create('Ext.form.Panel', {
                    bodyPadding: 10,
                    width: 300,
                    title: 'Pizza Order',
                    items: [
                            xtype: 'fieldcontainer',
                            fieldLabel: 'Toppings',
                            defaultType: 'checkboxfield',
                            items: [
                                    boxLabel  : 'Anchovies',
                                    name      : 'topping',
                                    inputValue: '1',
                                    id        : 'checkbox1',
                                    //checked   : true, //works                                
                                    value      : true //not works
                    renderTo: Ext.getBody()

    According to http:// 'A value to initialize this field with.'. Config does not work because checkbox has own implementation
    which uses 'checked' config instead 'value' config. By default all other fields use and 'value' config works as expected.

  2. #2
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Boise, ID


    Thanks for the report! I have opened a bug in our bug tracker.

    This falls in the documentation bug category as checkbox and radiofield will use checked: true to initialize the field as checked/selected.

  3. #3


    But it will be inconsistent behavior with other fields. I my project I have many configured fields then in runtime I read this configuration and create Ext fields. I do not want put additional logic to determinate if this checkbox or textfield for example. Could you please consider override initValue method just change 1 line from

    checked = !!me.checked;to

    checked = !!me.checked || !!me.value

Posting Permissions

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