论坛首页 Web前端技术论坛

在EXT中使用FCKEditor编辑器例子

浏览 19062 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2008-05-15  
大哥,确实取不到值啊
0 请登录后投票
   发表时间:2008-05-26  
大哥,再给个能用的版本。
0 请登录后投票
   发表时间:2008-06-26  
本人已经测试可行的代码

关键在于这几行代码

            var oFCKeditor=FCKeditorAPI.GetInstance('code1');   
            oFCKeditor.UpdateLinkedField();  
            //  alert(Ext.get("code1").dom.value);    
            alert(FCKeditorAPI.GetInstance('code1').GetXHTML( true ));    



这是最重要的生要的
oFCKeditor.UpdateLinkedField();


 
这两句是等效的
alert(Ext.get("code1").dom.value);    
 alert(FCKeditorAPI.GetInstance('code1').GetXHTML( true ));  



下面是详尽例子
Ext.onReady( function (){
        var top = new Ext.FormPanel({
            labelAlign : 'top',
            frame : true,
            title : '在线编辑器',
            bodyStyle : 'padding:5px 5px 0',
            width : 600,
            items : [{
                xtype:'textarea', //这是必须的
                  id : 'code1',//div节点,这里要挂接FCKeditor编辑器
                  fieldLabel : '请输入信息',
                height : 200,
                anchor : '98%'
            }],
            buttons: [{ 
                text: 'Save',
            handler:Msg 
            },{ 
                text: 'Cancel' 
            }] 
        });
        top.render(document.body); 
 
        //构造函数指出了要挂接的DIV结点,前面的id指出
        var oFCKeditor = new FCKeditor( 'code1',800,350 ) ; 
        oFCKeditor.BasePath = "resources/fckeditor/" ; 
        oFCKeditor.ToolbarSet = 'Default'; 
        oFCKeditor.ReplaceTextarea() ; 
        function Msg()
        { 
            var oFCKeditor=FCKeditorAPI.GetInstance('code1');   
            oFCKeditor.UpdateLinkedField();  
            //  alert(Ext.get("code1").dom.value);    
            alert(FCKeditorAPI.GetInstance('code1').GetXHTML( true ));    
        }  
    });
0 请登录后投票
   发表时间:2008-07-28  
你好,请问要在里面填加新的字体库该如何操作
0 请登录后投票
   发表时间:2008-10-23  
嗯,后面的那段程序调通了,可以用。

0 请登录后投票
   发表时间:2008-10-23  
FCKeditor is not defined
有这个错误要怎么改
0 请登录后投票
   发表时间:2008-11-03  
对 这个样子重用性不强 如果需要多个EDITOR呢?
0 请登录后投票
论坛首页 Web前端技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics