我想在用户更改 ExtJS 4 中的 HtmlEditor 的内容时捕获。我尝试了同步、更改和推送事件,但均未成功。每当获得焦点时,似乎都会触发同步,不会触发更改,而且我不知道是什么原因导致推送被触发。
当用户更改 HtmlEditor 的内容时,谁能知道触发了哪个事件?
谢谢
编辑:我尝试了以下对我不起作用的代码,有什么想法吗?
init: function() {
this.control({
'htmleditor[name="reportHtmlEditor"]': {
render: this.addKeyHandler
}
});
},
addKeyHandler: function(field) {
// This gets called fine on the component render
var el = field.textareaEl;
if (Ext.isGecko) {
el.on('keypress',
function() {
// Do Stuff, which never gets called
}, this, { buffer: 100});
}
if (Ext.isIE || Ext.isWebKit || Ext.isOpera) {
el.on('keydown',
function() {
// Do Stuff, which never gets called
}, this, { buffer: 100});
}
},
有关更多信息,我正在使用 Firefox 进行测试,并且我从这篇文章中获得了其他信息。