extjs4 与 kindeditor

<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl;?>/kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl;?>/kindeditor/plugins/code/prettify.css" />
<script charset="utf-8" src="<?php echo Yii::app()->request->baseUrl;?>/kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="<?php echo Yii::app()->request->baseUrl;?>/kindeditor/lang/zh_CN.js"></script>
<script charset="utf-8" src="<?php echo Yii::app()->request->baseUrl;?>/kindeditor/plugins/code/prettify.js"></script>
<script type="text/javascript">
Ext.require(['*']);

Ext.onReady(function(){
 Ext.QuickTips.init();
  /**
     * 信息内容
     */
    var content = new Ext.form.TextArea(
            {
                fieldLabel : '信息内容',
                maxLength : '1000',
                height : 150,
                maxLengthText : '文章提示信息长度不能超过2000字',
                name : 'content',
                id : 'content',
                emptyText : '无',
                anchor : '80%',
                listeners : {
                    "render" : function(f) {
                        K = KindEditor;
                        htmlEditor = K
                                .create('#content',
                                        {
                                            uploadJson : '<?php echo Yii::app()->request->baseUrl;?>/kindeditor/php/upload_json.php',//路径自己改一下
                                            fileManagerJson : '<?php echo Yii::app()->request->baseUrl;?>/kindeditor/php/file_manager_json.php',//路径自己改一下
                                            height : 200,
                                            width : '90%',
                                            // fontSizeTable:['21px','20px','17px','18px','16px','14px','12px'],
                                            resizeType : 1,
                                            allowPreviewEmoticons : true,
                                            allowImageUpload : true
                                        });
                    }
                }
            });

    var myForm = Ext.create('Ext.form.Panel',{
  layout:'absolute',
  url:'',
  defaultType:'textfield',
  border:true,
  items:[content]
 });
 var win = Ext.create('Ext.window.Window', {
        autoShow: true,
        title: 'Resize Me',
        width: 800,
        height: 300,
        minWidth: 300,
        minHeight: 200,
        layout: 'fit',
        iconCls: 'icon_add',
        plain:true,
        items: myForm,

        buttons: [{
            text: 'Send'
        },{
            text: 'Cancel'
        }]
    });
 
});
</script>

 

posted @ 2014-01-02 14:56  haiwei.sun  阅读(461)  评论(0编辑  收藏  举报
返回顶部