njentit
12 Sep 2008, 11:48 AM
my application have some bug when user drag the window, dragging is not smooth
another window fire their event when dragged over it.
my currently solution is add some code so all other window get ghosted while dragging.
changed file Window.js :
Ext.extend(Ext.Window.DD, Ext.dd.DD, {
moveOnly:true,
headerOffsets:[100, 25],
startDrag : function(){
var w = this.win;
// added by njentit
w.manager.each(function(wx){
if(wx.id!=w.id){
wx.dd.proxy = wx.ghost();
}
});
//end
this.proxy = w.ghost();
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])});
}
},
b4Drag : Ext.emptyFn,
onDrag : function(e){
this.alignElWithMouse(this.proxy, e.getPageX(), e.getPageY());
},
endDrag : function(e){
// added by njentit
this.win.manager.each(function(wx){
if(wx.id!=this.id){
wx.unghost();
//wx.saveState();
}
},this.win);
//end
this.win.unghost();
this.win.saveState();
}
});
i hope this help who have similar problem.
another window fire their event when dragged over it.
my currently solution is add some code so all other window get ghosted while dragging.
changed file Window.js :
Ext.extend(Ext.Window.DD, Ext.dd.DD, {
moveOnly:true,
headerOffsets:[100, 25],
startDrag : function(){
var w = this.win;
// added by njentit
w.manager.each(function(wx){
if(wx.id!=w.id){
wx.dd.proxy = wx.ghost();
}
});
//end
this.proxy = w.ghost();
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])});
}
},
b4Drag : Ext.emptyFn,
onDrag : function(e){
this.alignElWithMouse(this.proxy, e.getPageX(), e.getPageY());
},
endDrag : function(e){
// added by njentit
this.win.manager.each(function(wx){
if(wx.id!=this.id){
wx.unghost();
//wx.saveState();
}
},this.win);
//end
this.win.unghost();
this.win.saveState();
}
});
i hope this help who have similar problem.