【问题标题】:Dynamically add multiple CKEDitor in IFRAME Yii在 IFRAME Yii 中动态添加多个 CKEEditor
【发布时间】:2015-07-22 11:06:11
【问题描述】:

我需要 IFRAME Yii 中的多个 CKEditor。

我遵循了 link 它适用于没有 IFrame 但我有一个带有 IFrame 的弹出对话框 iframe 可与单实例编辑器一起使用,但我需要它多重

单例代码:

   <?php echo $form->textArea($model, 'message', array('id'=>'question_editor','maxlength'=>508)); ?>
    <script src="<?php echo Yii::app()->baseUrl.'/assets/ckeditor/ckeditor.js'; ?>"></script> 
    <script type="text/javascript">
    CKEDITOR.config.toolbar_MA=[ ['Format','Bold','Italic','Underline','-','Superscript','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','NumberedList','BulletedList','-','Outdent','Indent'] ,{ name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] },{ name: 'colors', items: [ 'TextColor', 'BGColor' ] },{name: 'insert',items:['Table','Image']},['Templates']];
    CKEDITOR.replace( 'question_editor', {   toolbar:'MA', height:'140px',width: '95%'  }  );
    </script>   

请任何人帮助我继续 IFRAME 中的多个 CKEditor 实例

【问题讨论】:

    标签: javascript php jquery iframe yii


    【解决方案1】:

    使用 Yii 代码或 HTML 创建另一个文本区域,根据您的命名约定更改名称和 id

    <textarea name="question_editor2" id="question_editor2" rows="10" cols="80">
           This is second editor.
      </textarea>
    

    将文本区域替换为 CKEDITOR

    <script>
      CKEDITOR.replace( 'question_editor2' );
    </script>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-01-13
      • 1970-01-01
      • 2017-09-07
      • 1970-01-01
      相关资源
      最近更新 更多