2010-08-11 17 views
7

He intentado todo lo siguiente:Cómo deshabilitar área de texto de TinyMCE

$(#"tbxNote").attr("disabled", "disabled"); ////doesn't work 
$(#"tbxNote").attr("disabled", "true"); //doesn't work either :) 

tinyMCE.init(mode: "none"); //throws an error 

Así es como yo estoy cargando TinyMCE:

//load tinymce plugin 
$('#tbxNote').tinymce({ 
    // Location of TinyMCE script 
    script_url: '/common/scripts/tiny_mce/tiny_mce.js', 

    // General options 
    theme: "advanced", 

    // Theme options 
    theme_advanced_buttons1: "link,unlink", 
    theme_advanced_buttons2: "", //important 
    theme_advanced_buttons3: "", //important 
    theme_advanced_toolbar_location: "top", 
    theme_advanced_toolbar_align: "left", 
    theme_advanced_statusbar_location: "bottom", 
    theme_advanced_resizing: false, 

    setup: function (ed) { 
     ed.onClick.add(function (ed) { 
      //ed.windowManager.alert('User clicked the editor.'); 
     }); 
    } 
}); 
+0

¿Solo necesita que sea de solo lectura o desea el estilo "deshabilitado"? –

+0

Solo lectura está bien, pero luego necesito habilitarlo usando jQuery. Me sale tinyMCE no está definido en la mayoría de los casos. – fuzz

Respuesta

10

Añadir readonly : true a sus parametros.

+0

Bien, eso funcionó. ¿Pero cómo volvería a habilitar el área de texto? – fuzz

+3

Pruebe algo como esto: 'Readonly' –

Cuestiones relacionadas