Results 1 to 2 of 2

Thread: Multiple instances of TinyMCE in EditView?

  1. #1
    skuliaxe is offline Senior Member
    Join Date
    Feb 2010
    Posts
    50

    Default Multiple instances of TinyMCE in EditView?

    I´m trying to add multiple instances of TinyMCE to a custom module.
    So far everything works in Firefox, Chrome, Safari and so forth but of course Internet Explorer is acting out as usual. In IE6 and 7 ( 8 not tested) only the last textarea is populated with the TinyMCE editor.

    Here is my "sugarcrm/custom/modulename/metadata/editviewdefs.php"
    In the header:
    PHP Code:
    // For TinyMCE use
    require_once("include/SugarTinyMCE.php");

    // Campo symptoms
    $tinySymptoms = new SugarTinyMCE();
    $tinySymptoms->FAQConfig['cleanup_on_startup']=true;
    $tinySymptomsHtml $tinySymptoms->getInstance('symptoms'); 
     
    // Campo description
    $tiny = new SugarTinyMCE();
    $tiny->FAQConfig['cleanup_on_startup']=true;
    $tinyHtml $tiny->getInstance('description');

    // Campo resolution
    $tinyResolution = new SugarTinyMCE();
    $tinyResolution->FAQConfig['cleanup_on_startup']=true;
    $tinyResolutionHtml $tinyResolution->getInstance('resolution'); 
    Below:
    PHP Code:
    => 
            array (
              
    => 
              array (
                
    'name' => 'symptoms',
                
    'studio' => 'visible',
                
    'customCode'=>'<textarea id="symptoms" name="symptoms">{$fields.symptoms.value}</textarea>{literal}'$tinySymptomsHtml '<script>focus_obj = document.getElementById("symptoms");</script>{/literal}',
                
    'displayParams'=>array('required'=>false,'rows'=>5,'cols'=>60),
                
    'label' => 'LBL_SYMPTOMS',
              ),
            ),
            
    => 
            array (
              
    => 
              array (
                
    'name' => 'description',
                
    'comment' => 'Full text of the note',
                
    'customCode'=>'<textarea id="description" name="description">{$fields.description.value}</textarea>{literal}'$tinyHtml '<script>focus_obj = document.getElementById("description");</script>{/literal}',
                
    'displayParams'=>array('required'=>false,'rows'=>5,'cols'=>60),
                
    'label' => 'LBL_DESCRIPTION',
              ),
            ),
            
    => 
            array (
              
    => 
              array (
                
    'name' => 'resolution',
                
    'studio' => 'visible',
                
    'customCode'=>'<textarea id="resolution" name="resolution">{$fields.resolution.value}</textarea>{literal}'$tinyResolutionHtml '<script>focus_obj = document.getElementById("resolution");</script>{/literal}',
                
    'displayParams'=>array('required'=>false,'rows'=>5,'cols'=>60),
                
    'label' => 'LBL_RESOLUTION',
              ), 
    And to display correctly in Detailview the "sugarcrm/custom/modulename/metadata/detailviewdefs.php the following is added to the corresponding arrays :
    PHP Code:
    'type' => 'HTML'
    As in:
    PHP Code:
    array (
                
    'name' => 'description',
            
    'type' => 'HTML',
                
    'comment' => 'Full text of the note',
                
    'label' => 'LBL_DESCRIPTION'
    Any ideas on how to fix that this works in Internet Explorer?
    I have tried removing the "," from the last line in the array but that did not change anything.

  2. #2
    mangesh1757 is offline Sugar Community Member
    Join Date
    Jan 2010
    Location
    India
    Posts
    226

    Default Re: Multiple instances of TinyMCE in EditView?

    for detail view try.

    'type' => 'html',

    Also you dont need to create multiple instance for each field to have tinyMCE editor, even this should work,

    $tinySymptomsHtml = $tinySymptoms->getInstance('symptoms,description,resolution');

    Thanks
    Last edited by mangesh1757; 2011-11-21 at 03:20 AM.
    Mangesh1757
    mangesh1757@gmail.com
    India.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Multiple SugarCRM Instances
    By anicolais in forum Help
    Replies: 6
    Last Post: 2010-01-13, 11:17 PM
  2. multiple instances in ie8 vs. ie7
    By Endoskeleton in forum Help
    Replies: 0
    Last Post: 2010-01-05, 12:41 PM
  3. Replies: 0
    Last Post: 2009-11-17, 11:31 PM
  4. Multiple Instances of SugarCRM
    By jsteinitz in forum Developer Help
    Replies: 4
    Last Post: 2007-04-22, 11:39 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •