首页 > 解决方案 > How to clear ckeditor value when another row of data is selected?

问题描述

I have a modal form containing a ckeditor. I use this modal form to fetch data in table. when i open first row of data, ckeditor shows the content but when i open another row of data in the same table, the ckeditor does not show the content of the selected row which means it only show the first selected row.

$(document).on('click', '.show-modal-announcement', function() {
            $('.modal-title').text('Announcement');
            $('#sid').val($(this).data('id'));
            $('#sannounce_to').val($(this).data('announce_to'));
            $('#sannounce_from').val($(this).data('announce_from'));
            $('#sannounce_cat').val($(this).data('announce_cat'));
            $('#sannounce_subject').val($(this).data('announce_subject'));
            $('#smessage').val($(this).data('message'));
            $('#screated_user_id').val($(this).data('created_user_id'));
            $('#screated_user_email').val($(this).data('created_user_email'));
            $('#screated_at').val($(this).data('created_at'));
            id = $('#sid').val();
              $(function () {
                  CKEDITOR.replace('smessage')
                  $('.textarea').wysihtml5()
                });
              CKupdate();
            $('#showModalAnnounce').modal('show');
        });

标签: modal-dialogckeditor

解决方案


推荐阅读