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();
}
}
});
分享到:
相关推荐
extjs htmleditor 图片上传和添加网络图片编辑器
Extjs_htmleditor插件
extjs 4.2 的HtmlEditor在chrome中高亮文字
ExtJs HtmlEditor 扩展 可上传视频上传文件上传图片
示例正则表达式集可过滤不需要的Microsoft Word粘贴标签和字符
完整的Extjs4 htmleditor上传图片插件(包括实例和用法) 有图片上传的前台和后台代码
myeclipse中使用extjs,缓慢、卡死、白屏,解决方法总结。
扩展ExtJs的HtmlEditor编辑器插入图片.pdf
extjs常见问题http://www.jb51.net/list/list_217_1.htm
extjs属性方法集中方便你查看学习,赶快来下载吧!学习extjs
Selenium识别Extjs控件的解决方法整理.pdf
项目进行前端框架升级——extJS 4升级至extJS6.6所遇的一些问题及相对应的解决方案建议
HtmlEditor(编辑器)的一个图片插件,制作过程用到了图片上传等,采用Struts1.2 ,上传组件使用的是Cos,这个插件的意义并不在于插件本身,只是希望给要用ExtJS做文件上传或想做ExtJS插件的朋友提供一种思路 ...
htmleditor扩展插入图片功能,使用Extjs+servlet请求实现。 htmleditor插入图片功能 Extjs servlet
Selenium IDE测试ExtJs一种测试解决办法
4、选择“ExtJS” 并点击“Add Library”然后在下拉条中选取“ExtJS”; 5、选择 “ExtJS”并点击“Add File”,然后在你的./ext-2.x/source目录中选取“ext.jsb” 文件; 6、设置新的ExtJS Profile,选中并点击...
extjs向action提交的方法,由Ext界面提交到action的两种方法,点击id为save的按钮时,执行loginFun函数。
Extjs+Gride使用方法 Extjs Gride
该文档里面的代码能够完美解决extjs的桌面图标换行问题,我亲自试用过
ExtJs4.2代码例子 ExtJS Window常用方法