extjs htmleditor readOnly无效解决方法

Ext 里的Ext.form.HtmlEditor里readOnly是无效的,俺的解决方法如下,希望对大家有用,另外有不同意见的或者更好的建议的可以提出来.


Ext.override(Ext.form.HtmlEditor, {
onResize : function(w, h){
Ext.form.HtmlEditor.superclass.onResize.apply(this, arguments);
if(this.el && this.iframe){
if(typeof w == 'number'){
var aw = w - this.wrap.getFrameWidth('lr');
this.el.setWidth(this.adjustWidth('textarea', aw));
this.iframe.style.width = aw + 'px';
if(Ext.isIE){
this.wrap.setWidth(aw);
}
if(this.readOnly){
this.onReadOnly();
}
}
if(typeof h == 'number'){
var ah = h - this.wrap.getFrameWidth('tb') - this.tb.el.getHeight();
this.el.setHeight(this.adjustWidth('textarea', ah));
this.iframe.style.height = ah + 'px';
if(this.doc){
this.getEditorBody().style.height = (ah - (this.iframePad*2)) + 'px';
}
}
}
},
// private
onReadOnly : function(){
this.unMaskWrap();
this.maskWrap(0);
},
// onDisable : function(){
// this.maskWrap(99);
// Ext.form.HtmlEditor.superclass.onDisable.call(this);
// },
// onEnable: function(){
// this.unMaskWrap();
// Ext.form.HtmlEditor.superclass.onEnable.call(this);
// },
maskWrap : function(opacity){
if(this.rendered){
var mask= this.wrap.mask();
mask.dom.style.zIndex = "0";
if(Ext.isIE){
mask.dom.style.filter = "alpha(opacity="+opacity||0+");";
}else{
mask.dom.style.opacity = opacity ? '"' + opacity/100 + '"' : "0";
}
}
},
unMaskWrap : function(){
if(this.rendered){
this.wrap.unmask();
}
}
});
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值