TextField“更改”事件仅在模糊时触发 [英] TextField 'Change' Event only triggers on blur

查看:122
本文介绍了TextField“更改”事件仅在模糊时触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常情况下,在TextField失去焦点(模糊)之后,Change事件将会触发。



但是我需要在字段的值而不需要失去对该领域的关注。



KeyListener不会削减它,因为值可能来自例如条形码扫描器。



有没有办法做到这一点?

提前致谢! $ b $我没有使用过ext-gwt,但这是你必须做的:你必须使用KeyListener并为ONPASTE添加一个监听器。 更改事件由浏览器提供,并且仅在焦点消失(模糊期间)以及文本已更改时触发。


Normally, the Change event will trigger after the TextField loses its focus (on blur).

But I need it to trigger as soon as the value of the field changes, without the need to lose the focus on the field.

The KeyListener doesn't cut it, because the value may come, for example, from a barcode scanner.

Is there any way to do achieve this?

Thanks in advance!

解决方案

I haven't worked with ext-gwt, but this is what you have to do: You have to use the KeyListener AND add a listener for ONPASTE. The 'Change' event is provided by the browser, and it is triggered only while focus goes away (during a blur), and if text has changed.

这篇关于TextField“更改”事件仅在模糊时触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆