在EXT中使用FCKEditor编辑器例子

转载自http://www.iteye.com/topic/170998

最近有朋友问我在EXT中使用FCKEditor编辑器遇到的一些问题,于是自己花一点时间写了一个例子,提供给大家学习。
例子已经配置好上传图片/flash/文件到服务器的功能,下载附件ext-fckeditor.rar,布署运行工程下的 /ext/examples/form/fckForm.html即可。如http://localhost: 8080/ext/examples/form/fckForm.html
代码如下:

  1. Ext.onReady(function(){ 
  2. var fckeditorFormPanel = new Ext.FormPanel({ 
  3.         labelWidth: 75,  
  4.         url:'', 
  5.         frame:true, 
  6.         title: 'fckeditor Form', 
  7.         bodyStyle:'padding:5px 5px 0', 
  8.         width: 950, 
  9.         height:450, 
10.         defaultType: 'textfield', 
11.  
12.         items: [{ 
13.                     xtype:'textarea', 
14.                     fieldLabel:'编辑', 
15.                     labelSeparator:':', 
16.                     id:'code', 
17.                     name:'code', 
18.                     height:200, 
19.                     width:300 
20.                 } 
21.         ], 
22.         buttons: [{ 
23.             text: 'Save' 
24.         },{ 
25.             text: 'Cancel' 
26.         }] 
27.     });   
28.     fckeditorFormPanel.render(document.body); 
29.     /**
30.          * 以下创建在线编辑器
31.          */ 
32.     var oFCKeditor = new FCKeditor( 'code',810,350 ) ;  
33.     oFCKeditor.BasePath = "/fckeditor/" ;  
34.     oFCKeditor.ToolbarSet = 'Default'; 
35.     oFCKeditor.ReplaceTextarea() ;   
36. });

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值