Sencha touch 2 更改sencha中的selectfield宽度
我有下一个代码:Sencha touch 2 更改sencha中的selectfield宽度,sencha-touch-2,textfield,Sencha Touch 2,Textfield,我有下一个代码: Ext.create('Ext.form.Panel', { fullscreen: true, items: [ { xtype: 'fieldset', title: 'Select', items: [ { xtype: 'selectfield', labe
Ext.create('Ext.form.Panel', {
fullscreen: true,
items: [
{
xtype: 'fieldset',
title: 'Select',
items: [
{
xtype: 'selectfield',
label: 'Choose one',
options: [
{text: 'First Option', value: 'first'},
{text: 'Second Option', value: 'second'},
{text: 'This is a long text to test the selectfield', value: 'third'}
]
}
]
}
]
});
我想更改selectfield的宽度,因为第三个选项很长。有和用于此的配置
编辑:
我终于用以下方法解决了这个问题:
.x-select-overlay{
min-width: 25em !important;
}
在app.scss中,上述结果将覆盖整个应用程序中的选择字段覆盖 为了更精确,您可以在特定的selectfield中使用select field
defaultPhonePickerConfig
或defaultTabletPickerConfig
覆盖width或height属性。例如`
{
xtype: 'selectfield',
defaultPhonePickerConfig: {
height: '8em',
width:'10em'
},
defaultTabletPickerConfig: {
height: '8em',
width:'10em'
},
}
是的,但这会在收缩时更改selectfield的宽度。当选项被展开时,它会返回到原来的大小。在这种情况下,用户可能会使用CSS:div.x-select-overlay{width:15em!important}感谢我使用过。x-select-overlay{minwidth:25em!important;}并且可以工作
{
xtype: 'selectfield',
defaultPhonePickerConfig: {
height: '8em',
width:'10em'
},
defaultTabletPickerConfig: {
height: '8em',
width:'10em'
},
}