2012-03-06 15 views
1

こんにちは、これは非常に大規模なシステムの一部です。私はいくつか不足している場合はそれを置くつもりはない、jQuery ajaxFormとCKEditorは保存しないでください

私はすべての今、jQueryのアダプタは、「コードの相互作用エディタのインスタンスを持つ」セクションの下部にajaxForm http://ckeditor.com/blog/CKEditor_for_jQueryで動作CKEditorバージョンのドキュメントにAccourding jQuerys ajaxForm http://jquery.malsup.com/form/ とCKEditorバージョンhttp://ckeditor.com

を使用していますコンテンツはAJAXでページにロードされ、 addonLoaderと呼ばれる機能がそれに渡されたデータに発射され、これは私のフォームは、このコード

function submitForm(formID){ 
    (function($){ 
     $(".addonContent form textarea.editor").each(function(index, element) { 
      $(this).ckeditor(function(e){ 
       this.updateElement(); 
      }); 
     }); 
     $(formID).submit(function(){  
      // prevent the browser redirect 
      return false; 
     }); 
     $(formID).submit(); 
    })(jQuery) 
} 

を発射する画像リンクによってsubmitedされるとCKEditorバージョン

// check there are not any instance's of CKEditor running 
    $(".addonContent form textarea.editor").each(function(index, element) { 
     $(this).ckeditor(function(){ this.destroy(); }); 
    }); 

    // add the content to the output area 
    $(".addonContent").html(data); 

    // setup Ajax form values 
    AJAXFormOptions = { 
     success:  addonLoader 
    }; 

    // activate ajaxForm on any forms from the data shown 
    $(".addonContent form").ajaxForm(AJAXFormOptions); 
// enable the content editor 
$(".addonContent form textarea.editor").ckeditor({width:"800px"}); 

を処理し、その関数のセクションです私はformIDが正しいことを確認しましたが、なんらかの理由でそれでもまだCKEditorの中に置かれているコンテンツでtextareaを更新していないのですが、この問題があり、修正方法を知っていますか?

+0

あなたはここに余分なカンマを持っています: '成功:addonLoader 'は、IE –

+0

を壊してしまい、修正しましたがエラーを止めません –

答えて

1

updateElement()を呼び出すために使用しているthisは、ckeditorオブジェクトではなくDOMノードです。あなたは、それは次のようにドキュメントからエディタインスタンスへのアクセスを取得する方法を示してアダプターリンクを

:今、あなたは呼び出すべきである

$(this).ckeditorGet().updateElement() 

var editor = $('.jquery_ckeditor').ckeditorGet(); 

はにthis.updateElement()を変更してみてくださいエディタインスタンスの更新

+0

それは完璧に働いてくれてありがとう –

関連する問題