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

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -