2014-04-01 43 views

回答

4

你需要調用

tinymce.execCommand('mceRemoveEditor', false, your_editor_id); 

改變你的配置paramters並調用

tinymce.execCommand('mceAddEditor', false, your_editor_id); 

如果你不知道如何編輯TinyMCE的paramters你可以使用這個調用

var init_obj = { 
    plugins: [ 
     "advlist autolink lists link image charmap print preview anchor", 
     "searchreplace visualblocks code fullscreen", 
     "insertdatetime media table contextmenu paste" 
    ], 
    toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image" 
    .... 
}; 

new tinymce.Editor(id_of_your_textarea_to_become_an_editor, init_obj, tinymce.EditorManager).render();