主题: Ext调用问题
作者: 新手, 发布日期: 2011-11-30 21:28:20, 浏览数: 4320

我原来用3.5版本的时候这么调用的

var are_fck = new Ext.form.TextArea({
            id: "MyFck",
            name: 'MyFck',
            listeners: {
                "render": function (f) {
                    KE.show({
                        id: 'MyFck',
                        imageUploadJson: '../../asp.net/upload_json.ashx',
                        fileManagerJson: '../../asp.net/file_manager_json.ashx',
                        height: 600,
                        width: 800
                    });
                    KE.create('MyFck');
                }
            }
        });

一切正常,

现在测试使用4.0版本

var are_fck = new Ext.form.TextArea({
            id: "MyFck",
            name: 'MyFck',
            listeners: {
                "render": function (f) {
                    KindEditor.ready(function (K) {
                        K.create('#MyFck', {
                            resizeType: 2,
                            uploadJson: '../../Ext/kindeditor/asp.net/upload_json.ashx',
                            height: '600px',
                            width: '800px'
                        });
                    });
                }
            }
        });

 死活都不出来编辑器,请教怎么回事

作者: 新手, 发布日期: 2011-11-30 22:21:40

原来网站有答案

3.5版本的写法

var are_fck = new Ext.form.TextArea({
            id: "MyFck",
            name: 'MyFck',
            listeners: {
                "render": function (f) {
                    KE.show({
                        id: 'MyFck',
                        imageUploadJson: '../../asp.net/upload_json.ashx',
                        fileManagerJson: '../../asp.net/file_manager_json.ashx',
                        height: 600,
                        width: 800
                    });
                    KE.create('MyFck');
                }
            }
        });

 

4.0版本的写法

 

var are_fck = new Ext.form.TextArea({
            id: "MyFck",
            name: 'MyFck',
            listeners: {
                "render": function (f) {
                    var K = KindEditor;
                    K.create('#MyFck', {
                        uploadJson: '../../Ext/kindeditor/asp.net/upload_json.ashx',
                        height: '600px',
                        width: '800px'
                    });

                }
            }
        });

 

 

哈哈

回复
作者: 羊的诱惑, 发布日期: 2012-05-21 11:18:52
您好,我试了下,出是出来了,但是取不到值,怎么办
回复
作者: 羊的诱惑, 发布日期: 2012-05-21 11:30:16

哈,解决了,加个全部变量htmlEditor
"render": function (f) {
                   var K = KindEditor;
                    htmlEditor = K.create('#ggcontent', {
                        uploadJson: '<%=basePath %>jsp/index/editor/jsp/upload_json.jsp',
                        fileManagerJson : '<%=basePath %>jsp/index/editor/jsp/file_manager_json.jsp',
                        height: '400px',
                        width: '580px',
                        resizeType : 1,
allowPreviewEmoticons : true,
allowImageUpload : true,
items : [
'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
'insertunorderedlist', '|', 'emoticons', 'image']
                    });
                }
然后再在提交表单的时候,加上htmlEditor.sync();就好了,谢谢楼主

回复
发表新帖 发表回复