在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. });
转载自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. });