Using inline CKEditor on dynamically added text -


i building web app uses javascript dynamically add elements page, can edited using contenteditable="true" , ckeditor.

currently if add element page contenteditable="true", element editable ckeditor toolbar not appearing.

i have tried calling ckeditor.inlineall() doesn't seem anything.

how can activate ckeditor inline editing on dynamically created elements? (without refreshing page).

edit: have found giving element id of (e.g.) someid , calling ckeditor.inline(someid) has desired effect. don't want have add unique ids of elements. there way activate ckeditor on contenteditable elements?

ckeditor.inline accepts native dom element parameter. no matter how create dynamic elements, if pass reference function, convert ckeditor instance. example, assuming use jquery main framework:

// dynamically created element. var el = $( '<p contenteditable="true">i\'m editable!</p>' );  // append element <body>. $( 'body' ).append( el );  // ckeditor.inline accepts dom element parameter. ckeditor.inline( el.get( 0 ) );  

see the fiddle.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -