extjs4与ckeditor、ckfinder整合

时间:2023-03-09 16:57:17
extjs4与ckeditor、ckfinder整合
<script type="text/javascript"src="<?php echo Yii::app()->request->baseUrl; ?>/ckeditor/ckeditor.js"></script>
<script type="text/javascript"src="<?php echo Yii::app()->request->baseUrl; ?>/ckfinder/ckfinder.js"></script>
<script type="text/javascript">
Ext.require(['*']);
Ext.onReady(function(){
	 var editForm = Ext.create('Ext.form.Panel', {
         frame : true,
         border : true,
         region:'center',
         height:500,
         width:800,
         renderTo:document.body,
         defaultType : 'textfield',
         defaults : {
            anchor : '100%'
         },
         items : [
                {
                   xtype :'textareafield',
                   inputId:'editor',//这个这个是html中的id属性
                   name:'editor'
                }
         ]
        });

    //替换textarea 文本框为 ckeditor
    var editor = CKEDITOR.replace( 'editor' );
    //设置ckfinder与ckeditor整合
    //参数1 为Ckeditor对象
    //参数2 为设置ckfinder.html对应所存在的目录
     editor.config.baseFloatZIndex = 19003;     CKFinder.setupCKEditor(editor, '/ckfinder/');

});

</script>