zk - 禁用组合框的键控 [英] zk - disable key controls for combobox
本文介绍了zk - 禁用组合框的键控的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可以停用 Combobox 的键盘控制功能ZK?
Is it possible to disable the keyboard controls for a Combobox in ZK?
也就是说,当用户在Combobox中输入一些文本时,默认情况下,他们可以使用箭头键来上下移动列表。我想禁用这个功能,因为它不能很好地与我们正在设计的用户体验。
That is, when a user enters some text into a Combobox, by default they can use the arrow keys to move up and down the list. I would like to disable this functionally as it doesn't work well with the user experience we are designing.
我在文档中没有看到明确的。
I see nothing in the documentation explicitly.
推荐答案
您可以覆盖_doKeyDown js函数,
You can override _doKeyDown js function,
例如,
<zk xmlns:w="client">
<combobox>
<attribute w:name="_doKeyDown"><![CDATA[
function (evt) {
var keyCode = evt.keyCode;
if (keyCode != 38 && keyCode != 40) {
this.$_doKeyDown(evt);
}
}
]]></attribute>
<comboitem label="item one" />
<comboitem label="item two" />
<comboitem label="item three" />
</combobox>
</zk>
这篇关于zk - 禁用组合框的键控的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文