I am using ckeditor in laravel 8. But can not show data in ckeditor From Ajax.
Here is my Ajax Code.
$('.edit').on('click', function() {
var id = $(this).data('id');
$.ajax({
type: "POST",
url: 'support-ticket-by-id',
data: {
id: id
},
dataType: 'json',
success: function(res) {
console.log(res);
$('#ajaxModelTitle').html("Edit");
$('#edit-modal').modal('show');
$('#id').val(res.id);
$('#edit_support_ticket_department_id').val(res
.support_ticket_department_id);
$('#edit_support_ticket_employee_id').val(res
.support_ticket_employee_id);
$('#support_ticket_priority').val(res.support_ticket_priority);
$('#support_ticket_subject').val(res.support_ticket_subject);
$('#support_ticket_note').val(res.support_ticket_note);
$('#support_ticket_date').val(res.support_ticket_date);
// $('#edit_support_ticket_desc').val(res.support_ticket_desc);
$('#support_ticket_status').val(res.support_ticket_status);
}
});
});
I want to show
support_ticket_desc
value in CkEditor.
Note: I used CkEditor in textarea html tag.
Thanks.
2
Answers
CKEDITOR.instances[‘edit_support_ticket_desc’].setData(res.support_ticket_desc)