0

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?

4

2 回答 2

1

为什么你不能只是

{
     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'}]
}
于 2013-09-30T10:56:47.793 回答
0

尝试为您的字段提供一些 CSS

input{float:right}
label{float:left}
于 2013-09-30T10:22:23.387 回答