tinymce removes the textarea -


i have weird problem,

first: tiny init:

function recargar_tiny(){                   // general options       tinymce.init({         // general options         mode : "textareas",         theme : "advanced",         plugins : "spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",          // theme options         theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",         theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",         theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",         theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",         theme_advanced_toolbar_location : "top",         theme_advanced_toolbar_align : "left",         theme_advanced_statusbar_location : "bottom",         theme_advanced_resizing : true,          // skin options         skin : "o2k7",         skin_variant : "silver",          // example content css (should site css)         content_css : "css/style.css",          // drop lists link/image/media/template dialogs         template_external_list_url : "js/template_list.js",         external_link_list_url : "js/link_list.js",         external_image_list_url : "js/image_list.js",         media_external_list_url : "js/media_list.js",          // replace values template plugin         template_replace_values : {                 username : "some user",                 staffid : "991234"         } });                  } 

and load form via ajax, , then, call tinymce init

this result: textarea gone firebug doesn't jumb error... :?

please note there should textarea there , there not... :?

ps: if don't via ajax, if onload works fine... driving me mad, can see something?

edit2

this ajax call tiny init

function editar_item(id, tipo){                     // id , tipo int id's                       $("#router").load('/includes/router.php?que=editar_item&id='+id+'&tipo='+tipo,{},function(){                             // <textarea id="texto" name = "texto">                             tinymce.execcommand('mceaddcontrol', false, 'texto');                       });  } 

now it's not removing textarea isn't loading wyswyg either.. :?

any idea?

-edit3-

if after jquery ajax call:

tinymce.init({    mode : "textareas",     theme : "advanced",     plugins : "inlinepopups",     media_strict: false,     // theme options     theme_advanced_buttons1 : "bold,italic,underline,strikethrough,forecolor,image,link,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,|,removeformat,|,bullist,numlist,|,outdent,indent",     heme_advanced_buttons2 : "",     theme_advanced_buttons3 : "",     theme_advanced_buttons4 : "",     theme_advanced_toolbar_location : "top",     theme_advanced_toolbar_align : "center",     theme_advanced_statusbar_location : "bottom",     theme_advanced_resizing : true,     editor_deselector : "no_tiny",       // example content css (should site css)     content_css : "/js/tinymce/examples/css/content.css",      // style formats     style_formats : [              {title : 'bold text', inline : 'b'},             {title : 'blue text', inline : 'span', styles : {color : '#006'}},             {title : 'blue header', block : 'h1', styles : {color : '#006'}},             {title : 'codigo fuente', inline : 'code', classes : 'prettyprint', exact: true}       ],      formats : {             alignleft : {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', classes : 'left'},             aligncenter : {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', classes : 'center'},             alignright : {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', classes : 'right'},             alignfull : {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', classes : 'full'},             bold : {inline : 'span', 'classes' : 'bold'},             italic : {inline : 'span', 'classes' : 'italic'},             underline : {inline : 'span', 'classes' : 'underline', exact : true},             strikethrough : {inline : 'del'},             customformat : {inline : 'span', styles : {color : '#00ff00', fontsize : '20px'}, attributes : {title : 'my custom format'}}     } 

});

then works!!! not al features need enabled.... :(

thanks!

you should use mode "exact" in init

mode: 'exact', 

then when ajaxrequest finished call

tinymce.execcommand('mceaddcontrol', false, editorid); //use textarea id editor_id here 

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -