Dataview drag and drop

  1. #1

    Dataview drag and drop

    HI i am doing a drag drop with a dataview and drag\drop zones
    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
  2. #2
    Hello!

    Please, wrap your code in CODE tag. Read paragraph 3 in this thread: http://forums.ext.net/showthread.php?10205
  3. #3
    I apologize for this. Re posted with suggested change .
  4. #4
    What error do you see in the Console? Is it possible to provide a full sample to reproduce?

Similar Threads

  1. Dataview drag and drop
    By rajatmig29 in forum 2.x Help
    Replies: 2
    Last Post: Sep 03, 2013, 4:51 AM
  2. [CLOSED] DataView Drag & Drop
    By softmachine2011 in forum 2.x Legacy Premium Help
    Replies: 12
    Last Post: Apr 12, 2013, 11:30 AM
  3. [CLOSED] DataView to DataView Drag and Drop
    By paulc in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: May 10, 2012, 8:19 PM
  4. Drag and drop reordering in Dataview
    By jophinm in forum 1.x Help
    Replies: 2
    Last Post: Nov 11, 2011, 11:19 AM

Tags for this Thread

Posting Permissions