Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    6
    Vote Rating
    1
    makarov_alx is on a distinguished road

      1  

    Default scroll during drag-n-drop

    scroll during drag-n-drop


    Hi,

    I need functional support for scrolling when you navigation upon drop target and already have some items to drop there. As it visible in example, gxt 3.x does not provide this functionality ( see, http://www.sencha.com/examples/#ExamplePlace:gridtogrid) , but it works for ExtJS (see, http://dev.sencha.com/deploy/ext-4.1...o-grid-dd.html)

    Any ideas ?

    thanks,
    Alex.

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,645
    Vote Rating
    80
    Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice

      0  

    Default


    The Tree DnD examples do have scroll support - take a look at the TreeDropTarget classes, and how the AutoScrollSupport type is used in there (calling start() and stop() at appropriate times). A subclass of GridDropTarget could also make these same calls to support this feature.

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    6
    Vote Rating
    1
    makarov_alx is on a distinguished road

      0  

    Default


    Thank you for your response.

    But as I see from source code, scrollSupport field appears only in TreeDropTarget as a privet field and is used in overridden method there onDragEnter. The way, as you describe, is duplicate same behavior in GridDropTarget's child with overridden onDragEnter, that smells bad!

    Why it is not implemented on GXT library level ?

    GridDropTarget does not provide any from-the-box opportunity to support AutoScrollSupport.

    And do you know how to make mouse wheel works during DnD ?

    thanks,
    Alex.

  4. #4
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,645
    Vote Rating
    80
    Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice

      -1  

    Default


    Its true that GridDropTarget doesn't have support for it - were I to add that today and get it right on the first try, it could be weeks or more before we have a release that would bring this feature to you, so I tried instead to explain how it worked and how it could be achieved in your own project quickly.

    GridDropTarget doesn't already include this, as you've noted - I suspect this is as the LiveGridView and other frequent modifications wouldn't support it well, but I'd need to dig in and try it to find out.

    With regard to the suggestion that this code 'smells bad', I think that this use of composition instead of inheritance is the right solution here. DragSource and DropTarget are mostly the logical details of DnD, and shouldn't be concerned with exactly how the UI will be implemented. For example, building a DropTarget for a TabPanel to drag tabs around won't use the same kind of AutoScrollSupport, as tab scrolling is not quite the same as overflow:auto that Tree and (normal) Grid uses.

    Additionally, AutoScrollSupport wraps up the scrolling details pretty neatly - as I tried to point out before, all that needs to be called from within any DropTarget is
    a) set it up, giving it the region to scroll (varies by use case)
    b) call start() when the drag enters the actual droppable region (may vary by widget)
    c) call stop() when the drag ends or leaves the droppable region (again, this varies).
    All of this variation means that we can't trivially just make a single subclass of DropTarget (call it ScrollableDropTarget) that ListViewDropTarget, TreeDropTarget, GridDropTarget could extend from. The purpose of the AutoScrollSupport type is to wrap all that behavior and logic, so those three steps above can be added, based on the rules and requirements of any class, DnD related or not.

    On your last question, I'm not entirely sure what prevents the scroll wheel from working, but I suspect it has to do with the other workarounds needed to prevent browsers from selecting text as the mouse keeps moving. That said, I'm barely agile enough to click, move the mouse, and scroll at the same time...

  5. #5
    Sencha User
    Join Date
    Apr 2012
    Posts
    6
    Vote Rating
    1
    makarov_alx is on a distinguished road

      0  

    Default


    Hi Colin,
    thanks again for such a long comment.

    As you have mentioned, you are planning to include changes regarding Grid and AutoScrollSupport into one of next GXT releases, could you say when we can expect it ?

    Also, It would be nice to see the code, which solves the problem, as you said you have it now;
    or you can take a look on code bellow, that I wrote.
    Unfortunately, my code does not make Grid auto-scrollable, I hope you help me figure what I did wrong.
    Code:
    package xxx.yyy.zzz;
    
    
    import com.sencha.gxt.core.client.dom.AutoScrollSupport;
    import com.sencha.gxt.dnd.core.client.*;
    import com.sencha.gxt.widget.core.client.grid.Grid;
    
    
    public class ScrollableGridDropTarget<T> extends GridDropTarget<T> {
    
    
        private AutoScrollSupport scrollSupport;
    
    
        public ScrollableGridDropTarget(Grid<T> grid) {
            super(grid);
        }
    
    
        @Override
        protected void onDragCancelled(DndDragCancelEvent event) {
            super.onDragCancelled(event);
            scrollSupport.stop();
        }
    
    
        @Override
        protected void onDragDrop(DndDropEvent e) {
            super.onDragDrop(e);
            scrollSupport.stop();
        }
    
    
        @Override
        protected void onDragEnter(DndDragEnterEvent e) {
            if (scrollSupport == null) {
                scrollSupport = new AutoScrollSupport(getGrid().getElement());
            } else if (scrollSupport.getScrollElement() == null) {
                scrollSupport.setScrollElement(getGrid().getElement());
            }
            scrollSupport.start();
            super.onDragEnter(e);
        }
    
    
        @Override
        protected void onDragFail(DndDropEvent event) {
            super.onDragFail(event);
            scrollSupport.stop();
        }
    
    
        @Override
        protected void onDragLeave(DndDragLeaveEvent event) {
            super.onDragLeave(event);
            scrollSupport.stop();
        }
    }
    as a last word, I would say it is really sad, that you are not able to use the brilliant opportunity to scroll during dnd because of you agility ....

    best regards,
    Alex

  6. #6
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,645
    Vote Rating
    80
    Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice

      0  

    Default


    Sorry if I wasn't sufficiently clear - I mean to say that even *if* I started the work right now, putting all bugs on hold to add a new feature, it would be some time before it would be available. I wouldn't expect this before 3.1, and no, I don't have a date on that.

    In your sample, you've (almost) discovered one of the interesting things that makes this hard to do!
    Code:
            if (scrollSupport == null) {
                scrollSupport = new AutoScrollSupport(getGrid().getElement());
            } else if (scrollSupport.getScrollElement() == null) {
                scrollSupport.setScrollElement(getGrid().getElement());
            }
    You are only getting the main wrapper element of the grid, which doesn't scroll. You can see this by trying to scroll in the grid, and noticing that the header (and optional footer) doesn't move. This almost certainly should be grid.getView().getScroller() or grid.getView().getBody() instead to properly have a reference to the part that scrolls. Plus test in all browsers, with TreeGrid (which extends Grid), with GroupingView, LiveGridView, and GroupingSummaryView.

    And as long as we are talking about future releases, touch support. Every feature that gets added has to be met by even more testing and future planning, so we don't break the API more than we have to. Many like GXT as it is today, but just want it more stable (we don't get all the bugs we run into as it is) - these people don't want changes to the API so their apps continue to work. Many people like the new features and look forward to modifying their apps to bring in any new achievements we can bring - these users tend to not mind the API updating so long as their features are added. We have to juggle both sides.

    Lastly - I'm a laptop user running linux - the touchpad is maybe 2.5in x 1.5in, and my hands stretch over an octave on the piano, so that as my normal use case doesn't work. Even with a mouse attached, I still have large, long fingers...

  7. #7
    Sencha User
    Join Date
    Apr 2012
    Posts
    6
    Vote Rating
    1
    makarov_alx is on a distinguished road

      0  

    Default


    Hi Colin,

    yes, getScroller() helps, thank you!

    I still have 2 questions :
    1) Does sencha has some public issue tracker where you can open ticket regarging AutoScrollSupport in Grid and I can follow up ? Just to be up to dateed regrding this problem.
    2) Who can give me answer on my question regarding scroll wheel ?

  8. #8
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,645
    Vote Rating
    80
    Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice

      0  

    Default


    The Bugs forum, where you posted, is where we publicly track the status of bugs. Following that theme, this will be marked as CLOSED, as there still isn't really a bug in here.

    We also have a Feature Request forum available to support subscribers.

    With regard to the scroll wheel issue, it appears that the Draggable type (which manages the actually dragging of items) listens to all events while you are dragging and invokes preventDefault() to stop them from actually happening. Among its useful side effect, this prevents text from being selected, and it appears to also stop key events and scroll events. One way to work around this would be to add another preview handler when the drag starts/stops in your own code, listen for Event.ONMOUSEWHEEL, and cause the scroll to occur.

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar