CKEditor 4 - Can't add Widget -
CKEditor 4 - Can't add Widget -
i'm making simple plugin add together richcombo
toolbar insert widget when 1 of options in dropdown menu clicked.
here's code:
ckeditor.plugins.add( 'myplugin', { init : function( editor ) { editor.widgets.add( 'widget1' ); editor.ui.addrichcombo( 'richcombo1', {...} ); } });
under chrome > inspect element> console
, says: uncaught typeerror: cannot read property 'add' of undefined
i'm using version 4.4.5
please help, nobody replies on ckeditor's forum.
you need widget plugin. otherwise editor.widgets
object not exist, hence error.
ckeditor.plugins.add( 'myplugin', { // load widget plugin. requires: 'widget', init : function( editor ) { editor.widgets.add( 'widget1', { // widget definition... } ); } } );
for more, see tutorial creating simple widget.
ckeditor
Comments
Post a Comment