This take me some time to research how to make tinymce in readonly mode.
The key point here is set readonly
to 1
or 0
, not true
or false
. For example here is my init code:
tinymce.init({
selector: "#html-textarea",
menubar: false,
statusbar: false,
resize: "both",
plugins: [
"textcolor image link preview code table media noneditable"
],
readonly: status, // **status hold value 0 or 1, NOT true or false**
toolbar: 'preview | undo redo | removeformat | cut copy paste | formatselect fontselect fontsizeselect | forecolor backcolor | bold italic underline strikethrough subscript superscript | alignleft aligncenter alignright alignjustify | link unlink image media | code table | bullist numlist | outdent indent blockquote'
});