2014-01-17 23 views
0

我想應用我的圖像來選擇sencha中的字段。如何更改在sencha中選擇字段樣式

那麼我該怎麼做。

我已經在類中創建爲

這裏是選擇現場

xtype: 'selectfield', 
       baseCls: 'x-field-select', 
       cls: 'selectclass', 
       id: 'fieldGeslacht', 
       name: 'pickergeslacht', 
       options: [ 
        { 
         text: 'Man', 
         value: 'Man' 
        }, 
        { 
         text: 'Vrouw', 
         value: 'Vrouw' 
        } 
       ], 
       usePicker: 'test', 
       component: { 
        useMask: true 
       } 

和類,我已經改變了煎茶主題的代碼是在這裏:

.selectclass 
{  
    overflow: hidden !important; 
    width: 90% !important; 
    margin-left: auto !important; 
    margin-right: auto !important; 
    color: white !important; 
    background: url("../img/registreren/2.JPG") no-repeat scroll 100% 0px #FFFFFF; 

} 

.x-selectmark-base, .x-field-select, .x-component-outer::after 
{ 
    overflow: hidden !important; 
    width: 90% !important; 
    margin-left:auto; 
    margin-right: auto !important; 
    color: white !important; 
    background: url("../img/registreren/2.JPG") no-repeat scroll 100% 0px #FFFFFF !important; 
    -webkit-mask-image:url("../img/registreren/2.JPG") !important; 
    -webkit-mask-size: 100% !important; 
} 

但是,這是不工作,所以請任何一個幫助我申請我的風格sencha選擇領域。

謝謝。

+0

複製粘貼+文本框左右你的ExtJS的代碼段。 –

+0

不適用於選擇字段。 –

+0

在這裏,我編輯我的文章,並添加內容爲選擇字段 –

回答

0

最近我用下面的CSS來選擇我的字段。希望這可以幫助你

.selectfield { 
display: block; 

.x-label-align-left { 
    &:first-child { 
     .x-form-label { 
     @if $include-border-radius { @include border-top-right-radius($form-fieldset-radius); } 
     } 
    } 

    &:last-child { 
     .x-form-label { 
     @if $include-border-radius { @include border-bottom-left-radius(0); } 
     } 
    }   
} 
.x-form-label { 
    span { 
     font-size: 14px; 
    } 
}  
.x-component-outer { 
    &:after { 
     margin-top: .5em; 
    } 
    &:before { 
     background: none; 
    } 
    .x-field-input{ 
     font-size: 14px; 
    } 
} 
} 

selectfield煎茶

  { 
      xtype : 'selectfield', 
      cls : 'selectfield', 
      margin : '5px', 
      usePicker : true, 
      }, 
0

嘗試只有baseCls不能同時這樣的代碼會是這樣

xtype: 'selectfield', 
       baseCls: 'selectclass', 
       id: 'fieldGeslacht', 
       name: 'pickergeslacht', 
       options: [ 
        { 
         text: 'Man', 
         value: 'Man' 
        }, 
        { 
         text: 'Vrouw', 
         value: 'Vrouw' 
        } 
       ], 
       usePicker: 'test', 
       component: { 
        useMask: true 
       } 
+0

一般來說,你不想使用baseCls。如有疑問,請使用cls。 –

+0

@Phil但你不需要sencha的風格.. baseCls覆蓋默認的類名稱。 –

+0

是的,如果你想徹底改變用戶界面,那麼使用baseCls是一種可行的方式。 #emptyCanvas –

相關問題