Extjs定义的Fckeditor控件

Ext.namespace('CRM.Panels');
    //Ext.BoxComponent 这里继承是参考的Ext.form.Field
CRM.Panels.Fckeditor = Ext.extend(Ext.BoxComponent, {
    initComponent: function() {
        var fckMainBodyId = this.fckMainBodyId == "" ? "fckMainBodyId" : this.fckMainBodyId;
        var fckMainBodyConfigId = this.fckMainBodyConfigId == "" ? "fckMainBodyConfigId" : this.fckMainBodyConfigId;
        var editorWidth = this.editorWidth == "" ? "100%" : this.editorWidth;
        var editorHeight = this.editorHeight == "" ? "300" : this.editorHeight;
        this.html = "<div>" +
            "<input type='hidden' value='' name='" + fckMainBodyId + "' id='" + fckMainBodyId + "'>" +
            "<input type='hidden' value='HtmlEncodeOutput=true' id='" + fckMainBodyConfigId + "'>" +
            "<iframe width='" + editorWidth + "' scrolling='no' height='" + editorHeight + "px' frameborder='no' " +
            "src='/fckeditor/editor/fckeditor.html?InstanceName=fckMainBody&amp;Channel=EWSOS&amp;" +
            "Toolbar=Default' id='fckMainBody___Frame' " +
            "style='margin: 0px; padding: 0px; border: 0px none; background-color: transparent; background-image: none; width: " + editorWidth + "; height: " + editorHeight + "px;'>" +
            "</iframe>" +
            "</div>";
    }
});
//把新建的自定义组件注册为一种xtype
Ext.reg('Fckeditor', CRM.Panels.Fckeditor);

/*使用:
items:[
{
xtype: "Fckeditor",
editorHeight: "600",
editorWidth:"100%"
}
]*/

 

转载于:https://www.cnblogs.com/anbylau2130/p/3637830.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值