Oct 15, 2013, 7:49 PM
Dataview drag and drop
HI i am doing a drag drop with a dataview and drag\drop zones
any clue ?
Thanks
Rajat
var getDragData = function (e) {
var view = App.ImageView,
sourceEl = e.getTarget(view.itemSelector);
if (sourceEl) {
d = sourceEl.cloneNode(true);
d.id = Ext.id();
return (view.dragData = {
sourceEl: sourceEl,
repairXY: Ext.fly(sourceEl).getXY(),
ddel: d,
patientData: view.getRecord(sourceEl).data
});
}
};
var getRepairXY = function () {
return this.dragData.repairXY;
};
var getTargetFromEvent = function (e) {
return e.getTarget(".hospital-target");
};
// On entry into a target node, highlight that node.
var onNodeEnter = function (target, dd, e, data) {
Ext.fly(target).addCls("hospital-target-hover");
};
// On exit from a target node, unhighlight that node.
var onNodeOut = function (target, dd, e, data) {
Ext.fly(target).removeCls("hospital-target-hover");
};
// While over a target node, return the default drop allowed class which
// places a "tick" icon into the drag proxy.
var onNodeOver = function (target, dd, e, data) {
return Ext.dd.DropZone.prototype.dropAllowed;
};
<ext:DragZone ID="DragZone1" runat="server" Target="={#{ImageView}.getEl()}" >
<GetDragData Fn="getDragData" />
<GetRepairXY Fn="getRepairXY" />
</ext:DragZone>
<ext:DropZone ID="DropZone1" runat="server" Target="={#{dvDroppedImage}.getEl()}">
<GetTargetFromEvent Fn="getTargetFromEvent" />
<OnNodeEnter Fn="onNodeEnter" />
<OnNodeOut Fn="onNodeOut" />
<OnNodeOver Fn="onNodeOver" />
<OnNodeDrop Handler="X.NodePredefinedImageDrop(data);" />
</ext:DropZone>
the code works perfectly for the first 6 images , but fails for the 7nt and subsequent images . wierd ??any clue ?
Thanks
Rajat
Last edited by Baidaly; Oct 21, 2013 at 4:03 PM.
Reason: Don't forget to use CODE tag