Results 1 to 3 of 3

Thread: override checkbox

  1. #1
    Ext JS Premium Member
    Join Date
    Dec 2011
    Posts
    232
    Vote Rating
    2
      0  

    Default override checkbox

    I use this code in order to change the values of the checkbox, but in some case I've got this error:
    Uncaught TypeError: Cannot read property 'length' of undefined

    This happened when I try to use the checkbox component, maybe becouse the checkbox has not yet been created.

    Ext.override(Ext.form.field.Checkbox,{
    inputValue: 'T',
    getValue: function () {
    return this.checked ? 'T' : 'F';
    }
    });

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,551
    Vote Rating
    1271
      0  

    Default

    I'm not getting any errors.

    Also, Ext.override is deprecated so your override should look like:

    Code:
    Ext.define('Override.form.field.Checkbox', {
        override : 'Ext.form.field.Checkbox',
    
        inputValue : 'T',
    
        getValue   : function () {
            return this.checked ? 'T' : 'F';
        }
    });
    And you can dynamically load it and take part in a build.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Ext JS Premium Member
    Join Date
    Dec 2011
    Posts
    232
    Vote Rating
    2
      0  

    Default

    Ok thanks!

Posting Permissions

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