Results 1 to 5 of 5

Thread: How to group sencha touch 2 radio fields

  1. #1
    Sencha User
    Join Date
    May 2013
    Posts
    6
    Vote Rating
    0
      0  

    Default How to group sencha touch 2 radio fields

    Here is the preview of my code what i get is this I want to group my radio fields like given below. How can I do it? what i need is this . Is there any plugin to do this?

    This is my sencha touch 2 code:

    Code:
    Ext.define('10.view.Main', {
        extend : 'Ext.form.Panel',
    
        requires : ['Ext.form.FieldSet'],
    
        config : {
            title      : 'Main',
            scrollable : 'both',
            editable   : false,
            items      : [
                {
                    xtype : 'fieldset',
                    items : [
                        {
                            xtype   : 'radiofield',
                            name    : 'color',
                            value   : 'red',
                            label   : 'Red',
                            checked : true
                        },
                        {
                            xtype : 'radiofield',
                            name  : 'color',
                            value : 'blue',
                            label : 'Blue'
                        }
                    ]
                }
            ]
        }
    });
    Last edited by mitchellsimoens; 19 May 2013 at 6:11 AM. Reason: fixed code

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      1  

    Default

    What part of that are you wanting? The checkmark?
    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
    Sencha User
    Join Date
    May 2013
    Posts
    6
    Vote Rating
    0
      0  

    Default

    No I need the other part. I need to locate Red and Blue next to the label "Color". like this Untitled.jpg

  4. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      0  

    Default

    I see, you will need to nest 2 text fields in an hbox layout container for each row. The first field has the label, second does not.
    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

  5. #5
    Sencha User
    Join Date
    Jul 2013
    Posts
    1
    Vote Rating
    0
      0  

    Default grouping sencha touch fields

    Ext.define('MyApp.view.RadioContainer', {
    extend: 'Ext.Container',
    alias: 'widget.RadioContainer',

    config: {
    height: '25%',
    layout: {
    type: 'hbox'
    },
    items: [
    {
    xtype: 'label',
    flex: 1,
    html: 'Colurs:',
    style: 'text-align:center;position:relative;top:25%;'
    },
    {
    xtype: 'container',
    flex: 3,
    items: [
    {
    xtype: 'radiofield',
    label: 'Red',
    name: 'red'
    },
    {
    xtype: 'radiofield',
    label: 'Blue',
    name: 'blue'
    }
    ]
    }
    ]
    }

    });

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
  •