0

私はモーダル内でYii1 CKEditorWidgetを呼び出しており、テキストはメインのテキストエリアに入力できますが、最初の送信では投稿されませんが、2番目の送信では投稿され、このウィジェットに関連付けられた他のすべてのテキストフィールドにも投稿されます。モーダルのような画像プロパティ、コード スニペット、テーブル プロパティは常に編集できません。この ckeditor は、そのビュー ページに読み込まれたモーダルではなく、ビュー ページで直接呼び出された場合に正常に動作します。モーダル自体の中で動作させるのを手伝ってくれる人はいますか?

1. ckeditor ウィジェットをロードするモーダル

2. ckeditor ウィジェットの編集不可能なテキストフィールド

これがモーダルの呼び出し方法です

<!-- ////start create new questions//////////// -->
<?php
$this->beginWidget('zii.widgets.jui.CJuiDialog',array(
    'id'=>'newqstnDlg',
    'options'=>array(
        'title'=>"Create and Add New Questions to Quiz",
        'autoOpen'=>false,
        'modal'=>'true',
        'width'=>'700',
        'height'=>'550',
    ),
)); ?>
<?php $this->widget('ext.loading.LoadingWidget');?>
<div id="divNewQuestions"></div>
<?php $this->endWidget('zii.widgets.jui.CJuiDialog');?>
<!-- ////End create new questions//////////// -->

そして、これがモーダル内で ckeditor ウィジェットが呼び出される方法です

<?php
$this->widget('ext.ckeditorNew.CKEditorWidget',array(
    "model"=>$model,                 # Data-Model
    "attribute"=>'question',          # Attribute in the Data-Model
    "defaultValue"=>$model->question,     # Optional
    # Additional Parameter (Check http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html)
    "config" => array(
        "height"=>"80px",
        "toolbar"=>"Custom",
        "toolbarGroups"=>array(["name"=>"insert"],["name"=>"tools"]),
        "extraPlugins"=>"widget,mathjax,uploadimage,codesnippet,eqneditor",
        "mathJaxLib"=>'//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-AMS_HTML',
        "filebrowserBrowseUrl"=>Yii::app()->createUrl('elfinder/index'),
        'filebrowserUploadUrl' =>$this->createUrl('teacher/uploadimages',array("ts"=>time())),
        //"imageUploadUrl"=>  Yii::app()->createUrl('elfinder/connector'),
        'filebrowserUploadMethod'=> 'form',
    ),
));
?>
4

0 に答える 0