【发布时间】: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