Showing posts with label disable rich text control. Show all posts
Showing posts with label disable rich text control. Show all posts

Saturday

How to disable the rich text control in share using JS

I was trying with read-only="true" to disable the rich text control for meta data in share-config-custom.xml. But unfortunately it does not work for me. So I tried with the following code snippet to disable the cm:description field.

 var lookupObject = Alfresco.util.ComponentManager.find({name : "Alfresco.FormUI"});
 var me = lookupObject[0];
        var tinyInstance = Dom.get(me.parentId+'_prop_cm_description_ifr');
        var tinyToolBar = Dom.get(me.parentId+'_prop_cm_description_toolbargroup');
        tinyInstance.contentDocument.body.contentEditable = false;
        tinyToolBar.hidden = "true";