extjs3 itemselector事件未被触发

时间:2011-12-07 09:58:48

标签: extjs4

我测试了所有操作,添加,删除,点击等..只有在监听器中触发的change事件:(
这是在我删除toField中的项目时发生的, 我真的想在向toField添加项目时触发事件(只需双击fromField项目)。

如何捕获此事件?

感谢。

var documentSelector = Ext.create('Ext.ux.form.ItemSelector', {
    name: 'documentSelector',
    fieldLabel: 'Document',
    anchor: '100%',
    store: a,
    valueField: "name",
    displayField: "name",
    allowBlank: false,
    msgTarget: 'side',
    listeners: {
        added: function(obj, event) {
            console.log("added");
        },
        change: function(obj, event) {
            console.log("change");
        },
        removed: function(obj, event) {
            console.log("removed");
        },
        blur: function(obj, event) {
            console.log("blur");
        },
        click: function(obj) {
            console.log('click');
        },
        select: function(obj) {
            console.log('select');
        }
    }
});

1 个答案:

答案 0 :(得分:0)

事件blurclick永远不会触发,因为它们不是itemSelector上的事件。 对于here(4.07),ItemSelector的事件记录为extjs

您可以使用更改事件并根据更改事件执行操作。 /** * @event change * Fires when a user-initiated change is detected in the value of the field. * @param {Ext.form.field.Field} this * @param {Object} newValue The new value * @param {Object} oldValue The original value */
添加处理程序以根据 newValue 更改事件或将 newValue oldValue

进行比较
相关问题