2017-04-06 106 views
0

我在ExtJS 6.0.1中有一个网格和rowEditing插件 网格中的一列是我定义的一个自定义组合框组件。 自定义组合框组件具有更改事件。但它并没有解雇。ExtJS定义组合框更改事件没有触发

这里是代码;

**//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

我不知道什么是你的代码错误,但这里是一个工作Fiddle
也许你在功能上或别的东西传递参数我不知道,但你可以在这个小提琴比较你的代码
希望它会工作:)

editable: true, 
+0

感谢您的答复,但我的comboBox是一个可编辑的组合框,就像一个文本框。当我在组合框中编写任何文本时更改事件不会触发 –

+0

您可编辑的含义是什么? –

+0

我更新小提琴看一看 –