Extjs htmleditor的插件未初始化
我有一个带有htmleditor(Extjs htmleditor的插件未初始化,extjs,extjs4,extjs4.2,Extjs,Extjs4,Extjs4.2,我有一个带有htmleditor(Ext.form.field.HtmlEditorView)的表单面板。 编辑器工作正常,但我不能在上面注册插件。下面代码中的插件永远不会初始化 Im使用ExtJS4.2 插件代码: Ext.define('Ext.ux.wysiwyg.Filemanager', { alias: 'plugin.filemanager', init: function(cmp){ console.log('init'); //Never ge
Ext.form.field.HtmlEditorView
)的表单面板。
编辑器工作正常,但我不能在上面注册插件。下面代码中的插件永远不会初始化
Im使用ExtJS4.2
插件代码:
Ext.define('Ext.ux.wysiwyg.Filemanager', {
alias: 'plugin.filemanager',
init: function(cmp){
console.log('init'); //Never gets initialized!
}
});
下面是我在htmleditor上注册插件的方式:
xtype: 'htmleditor',
plugins: [
Ext.create('Ext.ux.wysiwyg.Filemanager')
]
所以我的问题是:如何在htmleditor上获得插件?试试下面的示例代码,它对我有用 它取自,您也可以在代码编辑器/实时预览中进行测试 代码:
您正在面板上添加插件。我想在htmleditor上添加一个插件
cmp
应该是htmleditor对象。是的,很抱歉,现在添加到htmleditor
时它也可以工作<init()中的code>cmp.xtype
表示htmleditor
。请参见编辑。
Ext.define('Ext.ux.wysiwyg.Filemanager', {
alias: 'plugin.filemanager',
init: function(cmp){
alert( cmp.xtype ); // says "htmleditor"
}
});
new Ext.panel.Panel({
title: 'HTML Editor',
renderTo: Ext.getBody(),
width: 550,
height: 250,
frame: true,
layout: 'fit',
items: {
xtype: 'htmleditor',
enableColors: false,
enableAlignments: false,
plugins: [
Ext.create('Ext.ux.wysiwyg.Filemanager')
]
}
});