Ext JS 4 - How to control rowEditor inside control

2020-03-05 03:10发布

问题:

I want to learn how can I controller rowEditor plugin inside controller..

Here's rowEditor definition:

Ext.define(appName + '.view.department.DepartmentGrid', {

    initComponent: function() {

       this.rowEditor = Ext.create('Ext.grid.plugin.RowEditing', {
          clicksToEdit: 2
       });

    }

}

** Controller**

this.control({
    'departmentgrid': {
        // ??
    }
});

回答1:

It's in the docs: http://docs.sencha.com/ext-js/4-1/#!/api/Ext.grid.plugin.RowEditing-event-edit

this.control({
    'departmentgrid': {
        edit: this.onDepartmentGridEdit
    }
});