0
我在面板上有图像,图像为draggable = true,当移动图像时我想移动图像并更改其位置(x,y)只在其父面板内移动,不能移动到面板外面,我使用此功能,它是工作的,但图像可以在面板外面移动?!Extjs在面板上移动图像
function initializePatientDragZone(v) {
v.dragZone = Ext.create('Ext.dd.DragZone', v.getEl(), {
getDragData: function(e) {
var sourceEl = e.getTarget(v.itemSelector, 10), d;
if (sourceEl) {
d = sourceEl.cloneNode(true);
d.id = Ext.id();
return (v.dragData = {
sourceEl: sourceEl,
repairXY: Ext.fly(sourceEl).getXY(),
ddel: d,
patientData: v.getRecord(sourceEl).data
});
}
},
getRepairXY: function() {
return this.dragData.repairXY;
}
});
}
其中是'Ext.dd.dropZone'定义? –