Pages

Monday, October 25, 2010

Tny MCE Editor Problem

When you open mce-editor in popup just include following function

/**************Tiny Mce on POPUP**********************/
toggleEditor('con_des'); //text area id

function toggleEditor(id) {       
    if (tinyMCE.getInstanceById(id) == null){       
        tinyMCE.execCommand('mceAddControl', false, id);       
    } else {       
        tinyMCE.execCommand('mceRemoveControl', false, id);
    }
}

/***********************************************************/

Apply Editor ONLY to Specific textarea?

just add the attribute  'editor_selector'  in tinyMCE.init . The value for this attribute is a css class name which should be used in the textarea where  you want to apply  editor

For ex:


tinyMCE.init({
        // General options
        mode : "textareas",
        theme : "advanced",
        plugins : "safari,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",

       
editor_selector :"mceEditor",              // css  class


...... etc.

content_css : "../name.css",                //  css path

.... etc

);


and in the textarea tag

<textarea name="description" style="width:100%;" class="mceEditor">

No comments:

Post a Comment