2011-01-26 6 views
3

처음으로 대화 상자가 열리면 JQuery UI 대화 상자에서 CKEditor를 구현하려고합니다.JQuery UI 대화 상자가있는 CKEditor - 두 번째 시간이 표시되지 않습니다.

두 번째로 대화 상자를 열면 "스타일 : 숨김"으로 텍스트 영역이로드되고 편집기가로드되지 않습니까? 내 관리자 페이지에

대화

MyApp.Dialog = $('<div></div>'); 
     MyApp.Dialog 
     .dialog({ 
      modal: true, 
      autoOpen: false, 
      title: title, 
      width: width, 
      height: height, 
      close:function(){ 
       $(this).find('textarea').ckeditorGet().destroy(); 
      }, 
      buttons: { 
       'OK': function() { 
        form = $(this).find('form'); 
        if (form.validate().form() == true) { 
         MyApp.submitFormWithAjax(form, $(this)); 
        } else { 
         return false; 
        } 
       }, 
       Cancel: function() { 
        $(this).dialog('close'); 
       } 
      } 
     }); 

     MyApp.Dialog.load(url, function() { 
      EventManager.publish('showFormDialogLoaded'); 
     }); 

     MyApp.Dialog.dialog('open'); 

나는

$('.admin-create-article').click(function(event) { 
     MyApp.showFormDialog($(this).attr('href'), 'Neuer Artikel', 700, 630); 
     EventManager.subscribe('showFormDialogLoaded', function() { 
      $('.editor').ckeditor(function() {}, { skin : 'v2' }); 
     }); 
     event.preventDefault(); 
}); 

답변

4

나는 똑같은 문제가 있었지만 지금은 저에게 효과적입니다.

는 각 대화 구조합니다 (ckeditor를 생성하고 파괴)에 그 작업을 수행해야합니다 내가 대화 상자를 처음 열 때 내가 링크를 클릭하면

if (CKEDITOR.instances.editorD != null && CKEDITOR.instances.editorD != 'undefined') 
    { 
     CKEDITOR.instances.editorD.destroy(); 
    } 

     CKEDITOR.replace('editorD', 
     { 
     language : 'fr', 
     toolbar_Mytoolbardata : 
     [ 
     ['Bold','Italic','Underline','Strike'], 
     ['FontName','FontSize'], 
     ['TextColor']// No comma for the last row. 
     ], 
     toolbar : 'Mytoolbardata', 
     skin: 'v2', 
     width : 403,  
     height : 25, 
     disableObjectResizing : true, 
     resize_enabled : false, 
     shiftEnterMode : CKEDITOR.ENTER_BR, 
     toolbarCanCollapse : false, 
     forcePasteAsPlainText : true 
     }); 
+0

ckeditor v4.3을 사용하면 두 번째로 시작되지 않은 편집기 문제를 얻지 못했지만 두 번째 작업에는 툴바의 드롭 다운 요소가 있습니다. 이 솔루션으로 해결되었습니다. 감사. – frank

0

스크립트 파일이로드되지 않았거나 .. 대화 상자가로드되는 것을 기다리고 JQuery와 UI 스크립트와 같은 다른 스크립트와 충돌합니다.

+0

모든 것을 다시 대화 상자가 열리지 만 편집기가없는 작품. – opHASnoNAME

관련 문제