HtmlEditor key 事件
in Web前端 on extjs, javascript web 前端 - Hits()
ux.HtmlEditor = Ext.extend(Ext.form.HtmlEditor, {
frame : true,
initComponent : function() {
ux.HtmlEditor.superclass.initComponent.call(this);
this.addEvents('submit');
},
initEditor : function() {
ux.HtmlEditor.superclass.initEditor.call(this);
if (Ext.isGecko) {
Ext.EventManager.on(this.doc, 'keypress', this.fireSubmit,
this);
}
if (Ext.isIE || Ext.isWebKit || Ext.isOpera) {
Ext.EventManager.on(this.doc, 'keydown', this.fireSubmit,
this);
}
},
fireSubmit : function(e) {
if (e.ctrlKey && Ext.EventObject.ENTER == e.getKey()) {
this.fireEvent('submit', this);
}
}
});