Results 1 to 2 of 2

Thread: Togglefield and Label

  1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    25
    Vote Rating
    0
      0  

    Default Unanswered: Togglefield and Label

    I have a view that has the following code

    Code:
    Ext.define('MyApp.view.Profile', {
        extend: 'Ext.form.FormPanel',
        xtype: 'profilepage',    
        id: 'profilepage',
        action: 'profilepage',
        requires: ['Ext.form.FieldSet', 'Ext.field.Toggle'],
        
        config: 
        {
            title: 'Settings',
            iconCls: 'settings',
            styleHtmlContent: true,
            
            items: [
                {
                    xtype: 'fieldset',
                    title: 'Settings',
                    instructions: 'This will save setup information to your device',
                    
                    items: [
                        {
                            xtype: 'togglefield',
                            name: 'keepprofile',
                            label: 'Save Profile',
                            config:
                            {
                                maxValue: 1,
                                minValue: 0
                            }
                        }
                    ]
                }
            ]        
        },
        
        setupDisplay: function()
        {
        }    
    });
    And everything looks fine when my app.json contains

    Code:
    "js": [
            {
                "path": "sdk/sencha-touch-all.js"
            },
            {
                "path": "app.js",
                "update": "full"
            }
        ],
    but when I have

    Code:
    "js": [
            {
                "path": "sdk/sencha-touch.js"
            },
            {
                "path": "app.js",
                "update": "full"
            }
        ],
    The label 'Save Profile' on the toggle field dissapears, strange! I have tried putting a requires of 'Ext.Label' but still no luck.
    Last edited by mitchellsimoens; 30 Mar 2012 at 4:15 AM. Reason: added [CODE] tags

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

    Default

    It is recommended during development to use sencha-touch-debug.js . Here is code that is working for me using sencha-touch-debug.js from the 2.0.0 GA release:

    Code:
    Ext.define('MyApp.view.Profile', {
        extend   : 'Ext.form.FormPanel',
        xtype    : 'profilepage',
        action   : 'profilepage',
        requires : ['Ext.form.FieldSet', 'Ext.field.Toggle'],
    
        config :{
            title   : 'Settings',
            iconCls : 'settings',
            items   : [
                {
                    xtype        : 'fieldset',
                    title        : 'Settings',
                    instructions : 'This will save setup information to your device',
                    items        : [
                        {
                            xtype    : 'togglefield',
                            name     : 'keepprofile',
                            label    : 'Save Profile',
                            maxValue : 1,
                            minValue : 0
                        }
                    ]
                }
            ]
        }
    });
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

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

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Tags for this Thread

Posting Permissions

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