How to use CKEditor in a Bootstrap Modal?

后端 未结 14 1396
名媛妹妹
名媛妹妹 2020-11-30 04:14

If I use the CKEditor plugin in an HTML page based on a Bootstrap template, it works great, however if I insert the editor on a Bootstrap Modal like this

<         


        
14条回答
  •  难免孤独
    2020-11-30 04:53

    This worked for me with bootstrap 4.4 and ckeditor 4.14. All you need to do is to initialize the ckeditor in your modal's shown.bs.modal event.

    $('#yourModal')
        .on('shown.bs.modal', (e) => {
            CKEDITOR.replace('editor')
    });
    

    worked like a charm.

提交回复
热议问题