`
qq1988627
  • 浏览: 105964 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

FCKeditor与Extjs组合

 
阅读更多
Ext.form.FCKeditor.js

var oFCKeditorOptions = {
    BasePath : 'fckeditor/',   
    Config : {   
        ProcessHTMLEntities : true,   
        ProcessNumericEntities : false,   
        StartupShowBlocks : false,   
        ToolbarCanCollapse : false       
    },   
    ToolbarSet : 'Default'  
}; 
Ext.form.FCKeditor = function(config){
    Ext.form.FCKeditor.superclass.constructor.call(this, config);
    this.FCKid=0;
    this.MyisLoaded=false;
    this.MyValue='';
};

Ext.extend(Ext.form.FCKeditor, Ext.form.TextArea,  {
    onRender : function(ct, position){
        if(!this.el){
            this.defaultAutoCreate = {
                tag: "textarea",
                style:"width:100px;height:60px;",
                autocomplete: "off"
            };
        }
        Ext.form.TextArea.superclass.onRender.call(this, ct, position);
        if(this.grow){
            this.textSizeEl = Ext.DomHelper.append(document.body, {
                tag: "pre", cls: "x-form-grow-sizer"
            });
            if(this.preventScrollbars){
                this.el.setStyle("overflow", "hidden");
            }
            this.el.setHeight(this.growMin);
        }
        if (this.FCKid==0) this.FCKid=get_FCKeditor_id_value()
        setTimeout("loadFCKeditor('"+this.name+"');",100);
    },
    setValue : function(value){
        this.MyValue=value;
        if (this.FCKid==0) this.FCKid=get_FCKeditor_id_value()
        FCKeditorSetValue(this.FCKid,this.name,value)
        Ext.form.TextArea.superclass.setValue.apply(this,[value]);
    },
    
   
    
    getValue : function(){
        if (this.MyisLoaded){
            value=FCKeditorGetValue(this.name);
            Ext.form.TextArea.superclass.setValue.apply(this,[value]);
            return Ext.form.TextArea.superclass.getValue(this);
        }else{
            return this.MyValue;
        }
    },
    
    getRawValue : function(){
        if (this.MyisLoaded){
            value=FCKeditorGetValue(this.name);
            Ext.form.TextArea.superclass.setRawValue.apply(this,[value]);
            return Ext.form.TextArea.superclass.getRawValue(this);
        }else{
            return this.MyValue;
        }
    }
});
Ext.reg('fckeditor', Ext.form.FCKeditor);


function loadFCKeditor(element){
    oFCKeditor = new FCKeditor( element ) ;
    oFCKeditor.ToolbarSet = sFCKeditorToolbar ;
    oFCKeditor.Config['SkinPath'] = sFCKeditorSkinPath ;
    oFCKeditor.Config['PreloadImages'] = sFCKeditorSkinPath + 'images/toolbar.start.gif' + ';' +
                sFCKeditorSkinPath + 'images/toolbar.end.gif' + ';' +
                sFCKeditorSkinPath + 'images/toolbar.bg.gif' + ';' +
                sFCKeditorSkinPath + 'images/toolbar.buttonarrow.gif' ;
    oFCKeditor.BasePath = sFCKeditorBasePath ;
    oFCKeditor.Config['BaseHref']   = sFCKeditorBaseHref ;
    oFCKeditor.Height = 260 ;
    oFCKeditor.ReplaceTextarea();

}
function FCKeditor_OnComplete(editorInstance){

    Ext.getCmp(editorInstance.Name).MyisLoaded=true;

    editorInstance.Events.AttachEvent('OnStatusChange', function(){
        Ext.getCmp(editorInstance.Name).setValue();
    })
}
var FCKeditorvalue=new Array();
function FCKeditorSetValue(id,name,value){
    if ((id!=undefined)&&(name!=undefined)){
        if (value!=undefined) FCKeditor_value[id]=value;
        else if (FCKeditor_value[id]==undefined) FCKeditor_value[id]='';
        var oEditor = FCKeditorAPI.GetInstance(name) ;
        
        if(oEditor!=undefined) oEditor.SetData(FCKeditor_value[id])
    }
}
function FCKeditorGetValue(name){
    if ((id!=undefined)&&(name!=undefined)){
        var oEditor = FCKeditorAPI.GetInstance(name) ;
        data='';
        if(oEditor!=undefined) data=oEditor.GetData()
        return data;
    }
}
var FCKeditor_id_value;
function get_FCKeditor_id_value(){
    if (!FCKeditor_id_value){
        FCKeditor_idvalue=0;
    }
    FCKeditor_idvalue=FCKeditor_id_value+1;
    return FCKeditor_id_value;
}

导入相应的js

 <script type="text/javascript" src="fckeditor/fckeditor.js"></script>(fckeditor-java里面就是)
    <script type="text/javascript" src="js/fck.js"></script>(上面拓展js)

设置参数(设置fckeditor路径)

  <script type="text/javascript">
    	 var sFCKeditorToolbar = 'Default';
    	 var sFCKeditorBasePath = 'fckeditor/';
    	 var sFCKeditorBaseHref = 'http://localhost/HPDD1/';
    	 var sFCKeditorSkinPath = '../../fckeditor/editor/skins/office2003/';
    </script>

使用fckeditor js

 new Ext.form.FormPanel({
		title:'文章内容',
		labelAlign:'right',
                layout:'fit',
		labelWidth:60,
	        frame:true,
		items : [{
			id:n.id+'content',
                        name:id+'content',
			xtype:'fckeditor',      
			fieldLabel:'文章内容',
			height:100,
			anchor:'99%'
		}]
})
 
  • 大小: 38.6 KB
分享到:
评论

相关推荐

    FCKeditor结合extjs实例

    标题 "FCKeditor结合extjs实例" 描述的是一个实际项目中使用的技术组合,涉及到的主要是两个前端富文本编辑器库:FCKeditor 和 ExtJS。这个实例表明在开发企业级网站时,如何将这两者有效地整合以实现复杂的用户界面...

    Extjs结合fckeditor+c#实现新闻发布

    【标题】:“Extjs结合fckeditor+c#实现新闻发布”是一个基于Web的应用开发示例,它展示了如何使用Extjs作为前端框架,与富文本编辑器fckeditor集成,并利用C#后端语言来处理新闻发布功能。这一组合可以创建一个交互...

    FCKEditor与ext结合使用

    FCKEditor和EXT(ExtJS)都是JavaScript库,分别专注于文本编辑和构建复杂的用户界面。这篇文档将深入探讨如何将FCKEditor与EXT结合,以解决EXT编辑器的局限性,提升Web应用的用户体验。 **1. FCKEditor简介** ...

    extjs + fckeditor 的结合源码

    extjs + fckeditor 的结合源码 这个demo讲的是extjs + fckeditor 的结合 测试环境vs2008+xp+extjs2.2+fckeditor 2.x 大家运行Default.aspx就可以看到效果了

    fckeditor 与ext 集成使用

    **标题:“FCKeditor与EXT集成使用”** 在Web开发中,富文本编辑器和UI框架的集成是常见的需求,以便提供用户友好的界面和功能丰富的编辑体验。本主题主要探讨的是如何将FCKeditor(一个流行的开源JavaScript富文本...

    fckeditor与swfupload整合实例

    在"fckeditor与swfupload整合实例"中,我们主要关注如何将这两个工具结合起来,使用户能够在FCKeditor中方便地上传文件。整合过程通常包括以下几个步骤: 1. **安装和配置FCKeditor**:首先,你需要下载FCKeditor的...

    extjs + fckeditor 的结合asp.net版

    本人agd第一次发demo比较粗糙...这个demo讲的是extjs + fckeditor 的结合 这个demo网上有 但是是java版的 今天我把它转换成asp.net版 测试环境vs2008+xp+extjs2.2+fckeditor 2.x 大家运行Default.aspx就可以看到效果了

    Fckeditor皮肤Fckeditor皮肤

    4. **皮肤打包与应用**:Fckeditor的皮肤通常被打包成一个压缩文件,包含CSS、图片、JavaScript和其他必要资源。了解如何正确打包和命名这些文件,以便Fckeditor能识别和应用新皮肤,是开发过程中不可或缺的步骤。 ...

    EXTJS fckeditor 嵌入

    EXTJS fckeditor 嵌入 asp.net 测试通过,IE ,firefox都测试通过。有提取和设置值的方法。

    FCKeditor.Net_2.6.3.zip和FCKeditor-v2.6.3

    FCKeditor是一款强大的开源文本编辑器,主要用于网页内容的创建和编辑。它的名称来源于"Freeware Complete Kit for Web Editors"的首字母缩写,旨在提供一个功能丰富的HTML编辑器,让非技术人员也能轻松编辑网页内容...

    FCKeditor_2.6.8.zip

    FCKeditor与其他编辑器的比较** FCKeditor相比其他在线文本编辑器,如TinyMCE和CKEditor(FCKeditor的后续版本),在2.6.8版本时具有一定的优势,例如: - **易用性**:FCKeditor的用户界面友好,新手也能快速...

    FCKeditor 2.6.6 可直接使用

    5. **易于集成**:描述中提到可以直接复制到项目中使用,这表明FCKeditor提供了简单直观的API和教程,使得与其他系统或框架的集成变得非常便捷。 6. **使用文档**:随FCKeditor提供的使用指南详细介绍了如何安装、...

    FCKeditor && fckeditor.properties

    **FCKeditor与fckeditor.properties详解** 在JSP(JavaServer Pages)开发环境中,富文本编辑器FCKeditor是一款广泛使用的开源工具,它允许开发者在网页上创建具有类似Word功能的文本编辑区域,用户可以方便地进行...

    FCKEDITOR_ASP版

    FCKeditor是一款开源的JavaScript富文本编辑器,而这里的ASP版本则是将JavaScript编辑器与ASP服务器端代码集成,实现数据的提交和处理。 **FCKeditor** 是由Frederico Caldeira Knabben开发的一款强大的Web前端富...

    fckeditor所需jar包集合及java源文件

    下面将详细阐述FCKeditor与Java相关的知识点。 1. **FCKeditor简介** FCKeditor是一款基于JavaScript的富文本编辑器,它提供了一个类似Microsoft Word的界面,让用户在网页上编辑HTML内容。FCKeditor支持多种格式...

    fckeditor java Web开发完全组合包,及配置过程.rar

    这个压缩包"**fckeditor java Web开发完全组合包,及配置过程.rar**"包含了在Java Web环境下集成和使用FCKeditor所需的所有组件和步骤说明,由作者亲身体验并整理。 1. **FCKeditor 2.4.1**: 这是FCKeditor的一个...

    FCKeditor & FCKeditor.java & fck-faces

    FCKeditor与FCKeditor.java及fck-faces的结合使用,为Java Web开发者提供了一套强大的文本编辑解决方案,不仅方便了前端内容的编辑,还简化了后端的处理流程。在开发过程中,需要注意的是,由于FCKeditor生成的是...

    Fckeditor与Dorado进行结合

    Fckeditor与Dorado进行结合Fckeditor与Dorado进行结合

    Fckeditor(综合利用工具)

    9. **API接口**:Fckeditor提供了详细的API文档,开发者可以通过调用API来控制编辑器的行为,实现与后端系统的深度集成。 10. **自定义皮肤**:Fckeditor允许开发者自定义编辑器的外观,以匹配网站的整体风格。 在...

Global site tag (gtag.js) - Google Analytics