Fazil
Fazil

Reputation: 1390

Label alignment not fitting

Here is my code which I have used to align the selectfield and label in a same row, But it's not fitting like other textfields, here is the screen shot:

enter image description here

As like location and shop label name when I try with the category it's not fitting, Here is the code,

 {
     xtype: 'textfield',
     name : 'password',
     placeHolder : 'Add location',
     label: 'Location',
     id:'txtshopurl',
     useClearIcon: true
 }
 {
     xtype:'container',
     layout:'hbox',
     items:[{
          xtype: 'label',
          html: '<font size="2">Category</font>'
           },
           {
           xtype: 'selectfield',
           name: 'category',
           width: 150,
           options:[{text:'None(Default)',value:'D'},{text:'Birthday',value:'B'},{text:'Christmas',value:'C'},{text:'Aniversery',value:'A'},{text:'Wedding',value:'W'},{text:'Other',value:'O'}]
            }]
    }
    {
      xtype: 'textfield',
      name : 'Shopcategory',
      placeHolder : ' Shop name or URL',
      label: 'Shop Name',
      useClearIcon: true
    }

How do I align the category label and the select field in a same row?

Upvotes: 0

Views: 191

Answers (2)

Viswa
Viswa

Reputation: 3211

Why can't you just

{
     xtype: 'selectfield',
     name: 'category',
     label : 'Category',
     options:[{text:'None(Default)',value:'D'},{text:'Birthday',value:'B'},{text:'Christmas',value:'C'},{text:'Aniversery',value:'A'},{text:'Wedding',value:'W'},{text:'Other',value:'O'}]
}

Upvotes: 1

Anna Gabrielyan
Anna Gabrielyan

Reputation: 2170

try to give some css to your fields

input{float:right}
label{float:left}

Upvotes: 0

Related Questions