Home Forums FlexGanttFX cancel OnDragDropped

  • Author
    Posts
  • Martin
    Participant
    Post count: 10
    #12870 |

    Is it possible to cancel drop action of an activity when doing drag and drop?

    I did try the following code, with no success.

    graphics.setOnDragDropped(event ->

    {

    event.setDropCompleted(false);

    }

  • Dirk Lemmermann
    Keymaster
    Post count: 71
    #12874 |

    The drag and drop is completely encapsulated within FlexGanttFX, so you can not work with the DnD API. What you need to use are the callbacks on GraphicsBase. In this case the “row drag and drop callback”.

    
    /**
     * Specifies a callback that will be invoked when the user drags an activity
     * over a row of the given type. The callback implementation then determines
     * if a drop would be accepted in the given row.
     */
    public final void setRowDragAndDropCallback(Class< ? extends Row> rowType, Callback callback);
    

You must be logged in to reply to this topic.