今天extjs开发时,出现window拖动时出现透明的现象,网上找了很久终于找到了解决方法:
现引用如下:
该效果为ExtJS默认效果。 Ext的window之所以在拖拽的时候里头的控件会被蒙上,是因为window继承了标准的DD,在startDrag和endDrag函数当中加上了Ext.Fx的ghost方法的缘故。Ext.Fx是管理元素的动画效果的,ghost方法的作用是滑动淡出,详细看手册。只要把这两句话改掉就能实现window拖动无蒙板。在onReady函数前添加以下代码:
Ext.override(Ext.Window.DD,{
startDrag : function(){
var w = this.win;
this.proxy = w.getEl();
if(w.constrain !== false){
var so = w.el.shadowOffset;
this.constrainTo(w.container, {right: so, left: so, bottom: so});
}else if(w.constrainHeader !== false){
var s = this.proxy.getSize();
this.constrainTo(w.container, {right: -(s.width-this.headerOffsets[0]), bottom: -(s.height-this.headerOffsets[1])});
}
}, endDrag : function(e){
this.win.saveState();
}
});
现引用如下:
该效果为ExtJS默认效果。 Ext的window之所以在拖拽的时候里头的控件会被蒙上,是因为window继承了标准的DD,在startDrag和endDrag函数当中加上了Ext.Fx的ghost方法的缘故。Ext.Fx是管理元素的动画效果的,ghost方法的作用是滑动淡出,详细看手册。只要把这两句话改掉就能实现window拖动无蒙板。在onReady函数前添加以下代码:
Ext.override(Ext.Window.DD,{
startDrag : function(){
var w = this.win;
this.proxy = w.getEl();
if(w.constrain !== false){
var so = w.el.shadowOffset;
this.constrainTo(w.container, {right: so, left: so, bottom: so});
}else if(w.constrainHeader !== false){
var s = this.proxy.getSize();
this.constrainTo(w.container, {right: -(s.width-this.headerOffsets[0]), bottom: -(s.height-this.headerOffsets[1])});
}
}, endDrag : function(e){
this.win.saveState();
}
});