1. #1
    Sencha User
    Join Date
    Aug 2011
    Location
    Mumbai, India
    Posts
    119
    Answers
    11
    Vote Rating
    4
    Sasha172 is on a distinguished road

      0  

    Default Unanswered: Text Field CSS Bug with Multi word label

    Unanswered: Text Field CSS Bug with Multi word label


    Hi,
    I have a form with 3 columns. A checkbox, a textfield and another checkbox.

    When the label of the checkbox is more than a single word the textfield is getting a weird css error.

    My Code :
    Code:
    {
                id : 'q2Pulses',
                instructions : 'Can select MULTIPLE answers',
                title : '<font size=3>Question 2(a)(b)(c). : From these crop groups, which crop did you mainly cultivate in 2011? For selected crops, please tell me in how many acres were the crops grown? Which crops were grown by your farm in 2010</font>',
                items : [
                    {   
                        layout : 'vbox',
                        
                        defaults : {width : '100%', layout : 'hbox', defaults : {height : '100%'}},
                        items : [
                            {
                                items : [      //For a sort of header on the each column
                                    {xtype : 'spacer', width: '25%', style : 'background-color:#C0C0C0'},
                                    {xtype : 'field', labelWidth : '100%', label: 'Crops in 2011',width: '25%'},
                                    {xtype : 'field', labelWidth : '100%', label: 'Acreage (in Acres)', width : '25%'},
                                    {xtype : 'field', labelWidth : '100%', label: 'Crops in 2010', width: '25%'},
                                ]
                            },
                            {
                                items : [   // columns to fill
                                    {xtype : 'checkboxfield', name : 'q2a5',labelWidth : '60%', label: 'Bengal Gram', value : '5', width: '50%'},
                                    {xtype : 'textfield', name : 'q2b5', width : '25%'},   //error in the CSS Here
                                    {xtype : 'checkboxfield', name : 'q2c5', value : '1', width: '25%'},
                                ]
                            },
                            {
                                items : [
                                    {xtype : 'checkboxfield', name : 'q2a6',labelWidth : '50%', height: '100%', label: 'Black & Green Gram', value : '6', width: '50%'},
                                    {xtype : 'textfield', name : 'q2b6', width : '25%'},   //error in the CSS Here
    
    
                                    {xtype : 'checkboxfield', name : 'q2c6', value : '2', width: '25%'},
                                ]
                            },
                            {
                                items : [
                                    {xtype : 'checkboxfield', name : 'q2a7',labelWidth : '50%', label: 'Red Gram', value : '7', width: '50%'},
                                    {xtype : 'textfield', name : 'q2b7', width : '25%'},   //error in the CSS Here
    
    
                                    {xtype : 'checkboxfield', name : 'q2c7', value : '3', width: '25%'},
                                ]
                            }]
                    }
                ]
            }, //End of Q2abc

    The error looks like this :
    textfield error.jpg

    If you look under the "Acreage (in Acres)" column you can see the CSS error.

    The error is that instead of the textfield showing a blank white space as the background, it now shows a dived space. Half the field is the normal white css, the rest is greyed out and looks ugly.



    Not sure what the error is here Help !!!!

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,327
    Answers
    3540
    Vote Rating
    850
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Each row is a contianer and it should use hbox layout with align stretch. Each item them should use the flex config.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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.

  3. #3
    Sencha User
    Join Date
    Aug 2011
    Location
    Mumbai, India
    Posts
    119
    Answers
    11
    Vote Rating
    4
    Sasha172 is on a distinguished road

      0  

    Default


    No thats not working either. Tried that already. Looks exactly the same as it does now.

    Also if you notice, the more the words in the label, the greater the grey ugly area in the textfield.

    Any other ideas ??

  4. #4
    Sencha User
    Join Date
    Aug 2011
    Location
    Mumbai, India
    Posts
    119
    Answers
    11
    Vote Rating
    4
    Sasha172 is on a distinguished road

      0  

    Default


    Found a solution finally...

    Instead of using a label in the first checkbox field, Im using a "label" in the "field" component, and then the checkbox, textfield & the second checkbox are empty without labels

Thread Participants: 1

Tags for this Thread