简体   繁体   English

选择后从extjs组合框中删除突出显示

[英]Remove highlighting from extjs combobox after selection

Whenever an item is selcted from extjs combobox, it gets highlighted as follows 每当从extjs组合框中选择一个项目时,它就会如下突出显示

在此处输入图片说明

Is there any way to remove this highlighting. 有什么办法可以删除该突出显示。 I searched in google with no success. 我在Google搜索中没有成功。

I am using ExtJs 2.3.0 我正在使用ExtJs 2.3.0

First of all, you really need to consider upgrading your ExtJS version. 首先,您确实需要考虑升级ExtJS版本。 I haven't seen this behavior by default in the newer versions. 默认情况下,我在新版本中没有看到此行为。

Looking at the docs , in the config phase i don't see anythin which can help you. 文档 ,在配置阶段,我看不到任何可以帮助您的东西。

The simplest thing you can do is add a select listener where you call the selectText method 您可以做的最简单的事情是添加一个select侦听器,在其中调用selectText方法

     comboBox.on('select', function(combo,record,index) {
        // set the cursor at the start
        //comboBox.selectText(0,0);
        var cursorEnd =combo.getValue().length;
        comboBox.selectText(cursorEnd,cursorEnd);
    }); 

See working example with jsfiddle . 请参阅jsfiddle的工作示例 It uses a newer ExtJS for illustrative purposes, however the select event and selectText method are also available in ExtJS 2.3. 它出于说明目的使用了较新的ExtJS,但是在ExtJS 2.3中也可以使用select事件和selectText方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM