我在ExtJS 6.0.1中有一个grid和rowEditing插件 网格中的一列是我定义的自定义组合框组件。 自定义comboBox组件具有更改事件。但它没有解雇。
以下是代码;
**//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);
}
}
})
答案 0 :(得分:0)
我不知道您的代码有什么问题,但这是一个有效的Fiddle
也许你传递函数中的参数或其他我不知道的东西,但你可以将这个小提琴与你的代码进行比较
希望它能起作用:))
editable: true,