Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Extjs中禁用Combo时使其为空,然后用颜色填充_Extjs_Combobox - Fatal编程技术网

如何在Extjs中禁用Combo时使其为空,然后用颜色填充

如何在Extjs中禁用Combo时使其为空,然后用颜色填充,extjs,combobox,Extjs,Combobox,我有一个简单的要求。。禁用组合框后,如何使其变为空白?是否可以在不为空白选项添加值字段和显示字段的情况下执行此操作?< /P> 另外,当组合框被禁用且为空时,如何用特定颜色填充组合框 下面是我为组合框设置的内容 //PROTOCOL COMBO BOX! var protocol_cbox = new Ext.form.ComboBox({ typeAhead: true, triggerAction: 'all', // lazyRender: true ,

我有一个简单的要求。。禁用组合框后,如何使其变为空白?是否可以在不为空白选项添加值字段和显示字段的情况下执行此操作?< /P> 另外,当组合框被禁用且为空时,如何用特定颜色填充组合框

下面是我为组合框设置的内容

  //PROTOCOL COMBO BOX!
var protocol_cbox = new Ext.form.ComboBox({
    typeAhead: true,
    triggerAction: 'all',
   // lazyRender: true ,
    mode: 'local',
    store: new Ext.data.ArrayStore({
       id: 0,
       fields: [
           'myId',
           'displayText'
       ],
       data: [[1, 'Ethernet'], [2, 'Serial']]
   }),
   valueField: 'myId',
   displayField: 'displayText',
});
再一次。。我想实现使这个组合框为空,而不必在存储的数据字段中为它设置选项。这可能吗?基本上,当组合框启用时,我只希望下拉列表包含“Ethernet”和“serial”。。当禁用时,只需变为空白,然后用颜色填充即可

谢谢你们

用于设置样式,例如css选择器,以更改combo字段的颜色

.my-combo-disabled .x-form-field {
    background: none;
    background-color: red;
}
禁用时与空字符串一起使用,使其为空。
这里的提琴示例:

hmm我在哪里添加这个??在我的组合框内?新的挂载谢谢你的回复..我使用的是3.4 disabledCls在该版本中不可用。。还有其他建议吗?使用“disabledClass”配置,