Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.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组合框提前键入/单字符自动选择_Extjs_Combobox_Extjs4 - Fatal编程技术网

extjs组合框提前键入/单字符自动选择

extjs组合框提前键入/单字符自动选择,extjs,combobox,extjs4,Extjs,Combobox,Extjs4,我使用extjs combobox作为性别字段。它有两个值“M”和“F”。我想让它与键盘一起使用: { xtype: 'combo', typeAhead: true, queryMode: 'local', minChars: 1, triggerAction: 'all', store: [ ['M', 'M'], ['F', 'F'] ] } 如果我键入“Ftab”(大写),

我使用extjs combobox作为性别字段。它有两个值“M”和“F”。我想让它与键盘一起使用:

 {
     xtype: 'combo',
     typeAhead: true,
     queryMode: 'local',
     minChars: 1,
     triggerAction: 'all',
     store: [
          ['M', 'M'],
          ['F', 'F']
     ]
 }
如果我键入“Ftab”(大写),但不键入“Ftab”(小写),则此选项有效。如果我检查此代码,则typeahead可以工作:

 store: [
     ['M', 'Male'],
     ['F', 'Female']
 ]

有没有办法将值保留为“M”并使用小写字母?

不确定您是否已经解决了这个问题,但我遇到了类似的问题并找到了解决方案:

enableKeyEvents : true,
forceSelection : true,
typeAhead : false,
    listeners : 
    {
        'keyup' : function(me)
        {
            var val = me.getRawValue();
            if(val == 'm' || val == 'f')
                me.setValue(val.toUpperCase());
        }
    }
我还有一个网格,它让我为组合框中简单的是/否类型选择感到悲伤。我到处寻找答案,但还是想出了这个窍门


希望有帮助

将组合框“区分大小写”配置属性设置为false(区分大小写:false)。这应该可以解决问题。

您可以使用

listeners: {
  'specialkey': function(field, e) {
    if (e.getKey() == e.ENTER) {
      me.searchList(appMessage);
    }
  }
}

其中appMessage是传递的消息变量,field是要检查特殊情况的field的值。

能否确认您使用的浏览器和Ext版本,我已经用Ext 4.0.0和4.0.1进行了测试。4.0.1中修复了一个可能相关的小错误。我在Chrome(最新开发版本,13.something)和IE9上的extjs 4.0.1中看到了这个错误。我正在editorgrid中使用它,以防万一。当我按[tab]键时,该值会重置。我已使用4.0.2进行检查,Safari、Chrome或Firefox 4没有问题。我已迁移到jquery。我想它能用,但它不像我希望的那么干净。