1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    25
    Vote Rating
    0
    mcaple is on a distinguished road

      0  

    Default Unanswered: Togglefield and Label

    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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,656
    Vote Rating
    435
    Answers
    3108
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      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 @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    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 almost in print!

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

Tags for this Thread