【问题标题】:ExtJS defined combobox change event not firingExtJS 定义的组合框更改事件未触发
【发布时间】:2017-04-06 16:19:42
【问题描述】:

我在 ExtJS 6.0.1 中有一个网格和行编辑插件 网格中的一列是我定义的自定义组合框组件。 自定义组合框组件具有更改事件。但它没有开火。

这里是代码;

**//RowEditing Plugin**
var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
    clicksToMoveEditor: 1,
    autoCancel: false,
    clicksToEdit: 1,
    saveBtnText: 'Kaydet',
    cancelBtnText: 'Vazgeç',
    editing: true,
    listeners: {
        edit: function (editor, context, eOpts) {

        }
    }
});

**//GridPanel**
Ext.define('MailToTicketPersonsGrid', {
    extend: 'Ext.grid.Panel',
    xtype: 'MailToTicketPersonsGrid',
    id: 'mailToTicketPersonsGrid',
    store: mailToTicketPersonsStore,
    plugins: [rowEditing],
    columns: {
        items: [
            {
                text: 'Mail',
                flex: 1,
                dataIndex: 'mail'
            },
            {
                text: 'Ad',
                flex: 1,
                dataIndex: 'name',
                editor: {
                    xtype: 'textfield',
                }
            },
            {
                text: 'Soyad',
                flex: 1,
                dataIndex: 'lastName',
                editor: {
                    xtype: 'textfield',
                }
            },
            {
                text: 'Telefon',
                flex: 1,
                dataIndex: 'phone',
                editor: {
                    xtype: 'textfield',
                }
            },
            {
                text: 'Şirket',
                flex: 1,
                editor: {
                    xtype: 'CompanySearch',                        
                }
            }
        ]
    }
});


**//Window**
Ext.create('Ext.window.Window', {
    id: 'createUserWindow',
    layout: 'fit',
    border: 0,
    resizable: false,
    modal: true,
    bodyPadding: 10,
    width: 600,
    height: 300,
    listeners: {
        show: function () {

        },
        close: function () {
            Ext.getBody().unmask();
        }
    },
    items: [
        {
            xtype: 'panel',
            border: 0,
            layout: {
                type: 'vbox',
                align: 'stretch',
                pack: 'start'
            },
            items: [
                {
                    xtype: 'MailToTicketPersonsGrid',//grid
                    flex: 1
                }
            ]
        }
    ]
}).show();


**//Custom ComboBox**
    Ext.define('companySearch', {
    extend: 'Ext.form.field.ComboBox',
    xtype: 'CompanySearch',
    emptyText: 'Şirket ara...',
    editable: true,
    listeners: {
        change: function (field, newValue, oldValue, eOpts) {
            alert(newValue);
        }
    }
})

【问题讨论】:

    标签: extjs


    【解决方案1】:

    我不知道你的代码有什么问题,但这是一个有效的Fiddle
    也许您在函数中传递参数或其他我不知道的东西,但您可以将此小提琴与您的代码进行比较
    希望它会工作:)

    editable: true,
    

    【讨论】:

    • 感谢您的回复,但我的组合框是一个像文本框一样的可编辑组合框。我在组合框中写任何文本时更改事件未触发
    • 我现在把它设置为真快乐 :)
    • 如果您有答案,请接受以关闭问题
    • 我复制 - 粘贴了你的代码,它工作正常 :D :D。感谢@Salman hassan OkZ 的回复
    猜你喜欢
    • 2019-05-01
    • 1970-01-01
    • 2021-01-20
    • 1970-01-01
    • 1970-01-01
    • 2010-09-15
    • 1970-01-01
    • 1970-01-01
    • 2011-12-31
    相关资源
    最近更新 更多