ExtJS 4 Combobox事件用于选择所选值 [英] ExtJS 4 Combobox event for selecting selected value

查看:318
本文介绍了ExtJS 4 Combobox事件用于选择所选值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于某种原因,我需要知道用户何时从组合框中选择了值,即使它已被选中。仅当用户选择未选择的项目时,选择事件才有效。我没有在组合框或选取器的文档中看到任何类似itemclick的事件。有什么想法?

For some reason I need to know when user has selected value from combobox even if it is already selected. "Select" event works only if user selects unselected item. I don't see any event like "itemclick" in the docs for combobox or picker. Any ideas?

推荐答案

ComboBox 使用BoundList 用于表示下拉列表。 BoundList 触发 itemclick 事件。您可以使用 ComboBox listConfig 配置以设置 BoundList 听众:

ComboBox uses BoundList for representing dropdown list. BoundList fires itemclick event. You can use ComboBox's listConfig config in order to setup BoundList listeners:

Ext.create('Ext.form.ComboBox', {
    // ...
    listConfig: {
        listeners: {
            itemclick: function(list, record) {
                alert(record.get('name') + ' clicked');
            }
        }
    }
}

查看 demo

这篇关于ExtJS 4 Combobox事件用于选择所选值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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