Results 1 to 6 of 6

Thread: Canceling a drop event is not working

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    6

    Default Canceling a drop event is not working

    Required Information

    Version(s) of Ext GWT
    Ext GWT 3.0.0b

    Browser versions and OS
    (and desktop environment, if applicable)
    • Firefox 11, Windows 7


    Virtual Machine
    No

    Description
    I wanted to do a custom validation when the dragged files enter a drop area. In order to do so, I've overridden onDragEnter in my custom GridDropTarget:

    Code:
      @Override
      protected void onDragEnter(DndDragEnterEvent e) {
        super.onDragEnter(e);
        if (!valid) {
          e.setCancelled(true);
          e.getStatusProxy().setStatus(false);
        }
      }
    However, this does not cause the drop to be cancelled (and the icon remains the green tick).

    Run mode
    Development mode

    Expected result
    The feedback indicator changes to a "not allowed" one and the drop is cancelled (meaning, the dragged elements are not added to the ListStore, etc.)

    Actual result
    The drop succeeds.

    Test case
    This custom drop target should reject all drops - but it doesn't.
    Code:
    public class RejectingGridDropTarget<M> extends GridDropTarget<M> {
    
        public RejectingGridDropTarget(Grid<M> grid) {
            super(grid);
        }
        
        @Override
        public void onDragEnter(DndDragEnterEvent event) {
            super.onDragEnter(event);
            event.setCancelled(true);
            event.getStatusProxy().setStatus(false);
        }
    }
    Possible fix
    The problem seems to lie in DropTarget::handleDragEnter - on line 365, when e.isCancelled (for example, in the custom onDragEnter, as it was in my case), the original event gets its status proxy updated - but the 'cancelled' status of the original event is not updated. The control goes back to DNDManager, where on line 125 the (original) event's cancelled field is checked and will go to the else branch, even though we've tried to cancel the event earlier.

  2. #2
    Sencha User WesleyMoy's Avatar
    Join Date
    Oct 2009
    Location
    Redwood City, California
    Posts
    402

    Default

    Thanks for the report. I've filed a bug against the engineering team and will update here as soon as we have a fix.

  3. #3

    Default

    I can confirm that this is not working. Can you guys give us a workaround?

  4. #4
    Sencha User calbertts's Avatar
    Join Date
    Oct 2014
    Location
    Cali - Colombia
    Posts
    2

    Default

    I have the same problem with GXT 3.1

  5. #5
    Sencha User
    Join Date
    Jan 2015
    Posts
    29

    Default

    I have the same problem with GXT 3.1 on February 25, 2015. Please fix it.

  6. #6
    Sencha User
    Join Date
    Jan 2015
    Posts
    29

    Default

    This bug is not fixed. Please make it open again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •