I’m using Extjs 4.1.1. Because I follow MVC I decided to move ‘edit’ & ‘beforeedit’ functions (rowEditing plugin) from grid i.e:
listeners: {'edit': function(editor, e) {
...
},'beforeedit': function(editor, e) {
...
}}
and put it inside controller just like:
Ext JS 4 – How to control rowEditor inside controller
My new code looks like this:
init: function() {
this.control({
'myGrid': {
edit: this.onRowEdit
},
'myGrid': {
beforeedit: this.onRowBeforeEdit
},
});
},
onRowEdit: function(editor, e) {
... // Fires only when 'beforeedit' not present in this.control
},
onRowBeforeEdit: function(editor, e) {
... // Always fires
},
Now, ‘beforeedit’ fires fine. My problem is that ‘edit’ fires only when ‘beforeedit’ is not present. Anyone had same problem? Of course old grid listener like way worked fine for both.
EDIT
I’ve just observed that if I define ‘beforedit’ first and ‘edit’ second in this.control(), the ‘beforeedit’ is the one which is not firing.
Put them in the same selector:
It’s the same problem if I would be doing this: