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%' }] })?
详细解决方案
FCKeditor与Extjs结合
热度:352 发布时间:2012-11-23 00:03:43.0
相关解决方案
- Extjs grid 失去选中行的列数据
- extjs 后台有数据,但是返回到页面为空,jsonStore加载错误,这是咋回事
- S2SH、EXTJS、JSON调整后,EXTJS接收不到Struts2的Action传回的值,无语
- extjs 简单有关问题
- extjs+struts2解决办法
- ExtJs 处理 datetime 有关问题
- 【EXTJS】iframe里嵌套ext.window,怎样使ext.window弹出到iframe外,该怎么解决
- Tomcat + extjs 入门有关问题
- extjs ColumnModel 怎么实现表格中的数据小数点对齐
- Extjs 变量前的一个加号代表什么意思?解决方法
- extjs grid 怎么实现 行选中变色
- Tomcat启动错误 net.fckeditor.connector.ConnectorServlet
- ExtJs 提交表单的小疑点
- fckeditor 下传图片时如何把路径传到数据库里;或者当image文件夹中添加一张图片时立即就往数据库中添加其名称
- 怎么使用FredCK.FCKeditor
- FCKeditor 控件图标不显示,该怎么处理
- 用fckeditor插件报错:"/fckeditor/fckstyles.xml" Do you want to see more info?”解决思路
- FCKeditor 下传不了图片
- 自己写的Asp.net Ajax,Jquery,ExtJs 三种Ajax技术框架比较,希望大家提提意见,多谢
- fckeditor 配置上传音频文件 有关问题
- ckeditor ckeditor_aspnet fckeditor,该怎么解决
- 【加急】FCKeditor 2.6 怎么将编辑信息保存到SQLServer数据库?又怎么从数据库读取显示到页面
- 怎么给 Fckeditor 控件赋值的有关问题,不是取值!
- fckeditor 图片上传-生成文件夹【.net 2.0环境】解决方法
- FCKeditor html编辑器是免费的么,用于商业网站不会有版权的有关问题吧
- FCKeditor 不能显示自己上传的图片,多谢~
- FCKeditor 一个奇怪的图片显示有关问题
- FCKeditor 如何改变右键菜单的链接 清家当产求 急
- ASP.NET下使用[FCKeditor]有关问题,请高手帮忙
- fckeditor.net中如何用javascript操作