如何将extjs组合框的高度与css的样式区分开来

brqmpdu1  于 2023-03-08  发布在  其他
关注(0)|答案(2)|浏览(139)

extjs Ext.form.ComboBox项设置高度时无法使用

maxHeight: 100
minHeight: 100
maxBoxHeight: 100
minBoxHeight: 100

甚至列表中div的高度设置也不起作用。默认情况下,包含的div的高度设置为0px。知道如何操作高度吗?
html结构的形式是div中的div列表。

l7mqbcuq

l7mqbcuq1#

您正在搜索的设置是listConfig。在这里您可以设置将传递给Ext. view. BoundList的构造函数的配置属性。

Ext.create('Ext.form.ComboBox', {
   //[...]
    listConfig: {
        minWidth: 300,
        maxHeight: 40
    }
});

下面是一个完整的例子:
https://fiddle.sencha.com/#view/editor&fiddle/21bc

gzszwxb4

gzszwxb42#

我以前做过,对我很有效。
您可以为comboBox给予cls配置。

cls: 'textTransparent'

你可以用CLS来给予高度。

.textTransparent {
    height: 25px !important; // this will give the height
    font-size: 12px;
    font-weight: bold;
    color: white;
    margin: 0 !important;
}

相关问题