PDA

View Full Version : Opera version 12.11: Ext.Function.createInterceptor on EditorTab has stopped working



SergioKastro
4 Dec 2012, 6:14 AM
Hi:

I have a code that has been working in Opera until the latest updated (Lates Opeare version 12.11).

The code was creating an interceptor for the EditorTab on a grid. Once created this Interceptor, when we tab on the editable cells, first will run the interceptor with my code, and then it will run the default onEditorTab code, if my code returns true. If my code returns false, then it will stop the tabbing.



addOnEditorTabInterceptor: function() {
var me = this,
grid = me.getGrid(),
sm = grid.getSelectionModel();

sm.onEditorTab = Ext.Function.createInterceptor(sm.onEditorTab, function (editingPlugin, e) {
var me = this;

return !me.isLastEditableCell(); //When returns false then it will stop tabbing in gridEditor
});
}
}


This code is initialize on the initComponent method of a view.

As I have said, this code is working fine on IE, Chrome, Firefox and also in Opero version prior 12.11.

Has anyone experienced the same or similar problem?

mankz
4 Dec 2012, 7:39 AM
createInterceptor works fine in my Opera 12.11 (Mac). In console:


console.log = Ext.Function.createInterceptor(function() { document.body.innerHTML = new Date(); });
function() {
document.body.innerHTML = new Date();
}
>>> console.log('foo')

SergioKastro
4 Dec 2012, 11:33 PM
Yes, you are right. It works the function cretaeInterceptor correctly. I have retested, and the code works.
I need to investigate more other causes to find out then why the Interceptor I have created is not called

I apologize for my mistake.

SergioKastro
5 Dec 2012, 1:19 AM
But, do you know why it is not call the function 'onSpecialKey' when you tab out from a Grid?
I have been debugging on the others browsers, Firefox , Chrome and the onSpecialKey function is fired there.
But not in Opera.

If the onSpecialKey is not fired then the onEditorTab neither is called. So the interceptor function never is called.

On the Grid object I have set a plugin: Ext.grid.plugin.CellEditing
Like this:


initComponent: function () {
var me = this,
assignmentDetailGrid;


assignmentDetailGrid = {
xtype: 'Ext.grid.View',
itemId: 'assignmentDetailGrid',
dockedItems: [],
columns []
};

Ext.apply(assignmentDetailGrid, {
plugins: [
Ext.create('Ext.grid.plugin.CellEditing')
]
});

Ext.apply(me, {
items: assignmentDetailGrid
});


me.callParent(arguments);

// Method to create an Interceptor onEditorTab.
me.addOnEditorTabInterceptor();
},


addOnEditorTabInterceptor: function() {
var me = this,
grid = me.getAssignmentDetailGrid(),
sm = grid.getSelectionModel();


sm.onEditorTab = Ext.Function.createInterceptor(sm.onEditorTab, function (editingPlugin, e) {
var me = this;


return !me.isLastEditableCell(); //When returns false then it will stop tabbing in gridEditor
});
}
}






And I am trying to use the interceptor when we tab out on the cell editor using the method onEditorTab.


All that code that I have pasted it is working fine in all browsers except in Opera version 12.11 (even in previous version of Opera, the same code works fine)