Skip to content Skip to sidebar Skip to footer

Finding Textarea By Id No Longer Works When Implementing Ckeditor

I have a table of information where the user is allowed to edit it. In one cell, there is text information. Should the user click on that cell, a bootstrap modals appears with a te

Solution 1:

Ok, I found the solution. I hope this helps someone else in the near future:

I just added the following code when opening the modal:

/*Open a modal*/
$('#modal-notes').modal('show');
$('#modal-notes').on('shown.bs.modal', function() {
    console.log('Modal has been opened.');
    $(this).find('#observations').text(previousValue);
});

CKEDITOR.replace('observations');
CKEDITOR.instances.observations.setData(previousValue);

And that was it.

I had another problem when clicking many modals. Solution is here.

Post a Comment for "Finding Textarea By Id No Longer Works When Implementing Ckeditor"