1. #1
    Sencha User
    Join Date
    Jul 2013
    Posts
    6
    Vote Rating
    0
    L00der is on a distinguished road

      0  

    Default Unanswered: Drop target for Draggable

    Unanswered: Drop target for Draggable


    Hello!
    I have three panels
    How i can add three drop target for Draggable.

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,734
    Answers
    109
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    Draggable doesn't use DropTarget, it just means that the object can be moved around the page. DropTarget is meant to work with a DragSource, which has an internal Draggable instance.

    What are you trying to do? If you are dragging panels around, does it make sense to use the Portal layout container? http://www.sencha.com/examples/#Exam...e:portallayout

  3. #3
    Sencha User
    Join Date
    Jul 2013
    Posts
    6
    Vote Rating
    0
    L00der is on a distinguished road

      0  

    Default


    I want to be drag and drop widgets for a certain part on different panels.Draggable allows you to drag items from a header, but only within a single panel.portallayout is almost what I want, but I need to be able to resize the columns like this:
    http://www.sencha.com/examples/ # Ex...amicattribute)

  4. #4
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,734
    Answers
    109
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    There are several ways to do this, depending on exactly what kind of control you need over the process. Wrapping each widget in a DragSource will enable it to be dragged as-is, and building a DropTarget around another widget will let it receive the widget when dropped. You must then either subclass DragSource/DropTarget or add event handlers to listen to the start/move/end events to remove the widget from its original place and add it to the new one, or copy it, or whatever your logic requires. The BorderLayoutContainer doesn't drag and drop widgets, but draws SplitBars between the areas and listens to the SplitBarDragEvent to see when to change sizes and by how much.

  5. #5
    Sencha User
    Join Date
    Jul 2013
    Posts
    6
    Vote Rating
    0
    L00der is on a distinguished road

      0  

    Default


    I did it.
    But I want to be able to set DragHandle in DragSource. (or set DropTarget in Draggable)
    Draggable have this constructor:
    Code:
      /**
       * Create a new draggable instance.
       * 
       * @param dragComponent the widget to be dragged
       * @param handle the widget drags will be initiated from
       */
      public Draggable(final Widget dragComponent, final Widget handle)
    DragSource no such possibility.

Thread Participants: 1

Tags for this Thread