TextField“更改”事件仅在模糊时触发 [英] TextField 'Change' Event only triggers on blur
问题描述
但是我需要在字段的值而不需要失去对该领域的关注。
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屋!