Thursday, May 3, 2012

How to convert Salesforce rich text editor to a “full mode” editor? - PART II

<apex:page standardController="Configuration_Item__c" standardStylesheets="true" showHeader="true" sidebar="true">
<script> 
  $(document).ready(function(){

        CKEDITOR.on('instanceReady', function(e) {
            if (e.editor.config.magic) return;
            var target = e.editor.config.bodyId;
            var name = e.editor.name;
            e.editor.destroy();

            CKEDITOR.editorConfig = function( config ) { config.magic = true; }
            CKEDITOR.replace(name, {
                        height : 400, 
                        bodyId : target
            });
        });
    });
</script>    
<apex:form id="theForm">
       <apex:pageBlock id="thePageBlock">
       <apex:pageBlockSection columns="1" id="internalSection">
                <apex:pageBlockSectionItem >
                    <apex:outputLabel >SalesforceBasic</apex:outputLabel>
                   <apex:inputField value="{!Configuration_Item__c.Test_Rich__c}"/>
                </apex:pageBlockSectionItem>
          </apex:pageBlockSection>
       </apex:pageBlock>
   </apex:form>

</apex:page>

1 comment: