Results 1 to 4 of 4

Thread: Drag & Drop on scrolled grid issue

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium User
    Join Date
    Nov 2010
    Posts
    23

    Exclamation Drag & Drop on scrolled grid issue

    When drag record(s) to grid that is scrolled down already, drop indicator position is incorrect. Actually it doesn't take in account scroll position.

    What I found, in Ext.view.DropZone there is positionIndicator method. Here is such code:
    Code:
    ...
                    indicatorY = Ext.fly(node).getY() - Ext.fly(view.getNodeContainer()).getY() - 1;
                    if (pos === 'after') {
                        indicatorY += Ext.fly(node).getHeight();
                    }
    
    
                    me.getIndicator().setWidth(Ext.fly(view.el).getWidth()).showAt(0, indicatorY);
    ...
    but indicator is a child of view:

    Code:
        getIndicator: function() {
            var me = this;
    
    
            if (!me.indicator) {
                me.indicator = new Ext.Component({
                    ariaRole: 'presentation',
                    html: me.indicatorHtml,
                    cls: me.indicatorCls,
                    ownerCt: me.view,
                    floating: true,
                    alignOnScroll: false,
                    shadow: false
                });
            }
            return me.indicator;
        }
    so
    Code:
    ....showAt(0, indicatorY)
    should position indicator relative to view, but
    Code:
    indicatorY = Ext.fly(node).getY() - Ext.fly(view.getNodeContainer()).getY() - 1;
    always return position relative to scrollable, and same row here will always have same Y. I've changed it to be relative to view and it worked for me:

    Code:
    indicatorY = Ext.fly(node).getY() - view.el.getY() - 1;
    Maybe this will help someone

  2. #2

    Default

    In 6.5.2, I found below issue:

    container = (scrollableEl && !scrollableEl.isScrollable()) ? scrollableEl : Ext.fly(view.getNodeContainer());
    indicatorY = Ext.fly(node).getY() - container.getY() - 1;
    if (pos === 'after') {
    indicatorY += Ext.fly(node).getHeight();
    }

    "container" becomes same as node after second Ext.fly. It's globally shared flyweight Element. Then the indicator always show at (0, -1). When I change as below, it works.

    container = (scrollableEl && !scrollableEl.isScrollable()) ? scrollableEl : Ext.fly(view.getNodeContainer());


    var containterY = container.getY(),
    nodeDom = Ext.fly(node),
    nodeY = nodeEl.getY();


    indicatorY = nodeY - containterY - 1;


    if (pos === 'after') {
    indicatorY += nodeEl.getHeight();
    }

  3. #3
    Sencha Premium User
    Join Date
    Sep 2017
    Posts
    7

    Default

    Helped me a lot! Thank you! (Also Extjs 6.5.2 in Ext.view.DropZone, function positionIndicator)

    I logically don't understand the negation here "container = (scrollableEl && !scrollableEl.isScrollable()) ? scrollableEl : Ext.fly(view.getNodeContainer());"
    When i have a scrollableEl && this Scrollable Element "isScrollable" why shouldn't i want to have the scollableEl. Truly i am searching exactly this one.


    I removed the negation in front of
    scrollableEl.isScrollable() and it worked for me.

    Cheers.

  4. #4
    Sencha Premium Member
    Join Date
    Jun 2011
    Location
    NL
    Posts
    253

    Default

    Thanks @steppe87!

    The bug is still present in 6.5.3, but current nightlies are OK now.

    Fiddle with override:

Similar Threads

  1. Drag and drop over an Ext.ux.IFrame scrolled has an offset
    By raphael.franchet in forum Ext:Bugs
    Replies: 2
    Last Post: 23 Jan 2015, 12:57 PM
  2. Grid drag and drop issue.
    By telo.tao.yang in forum Ext: Q&A
    Replies: 1
    Last Post: 25 Jul 2013, 8:46 AM
  3. Drag Drop issue with grid
    By gctram in forum Sencha Ext JS Q&A
    Replies: 7
    Last Post: 7 Jul 2011, 12:17 PM
  4. grid drag drop issue
    By ByteLess in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 18 Aug 2010, 4:28 AM
  5. Replies: 10
    Last Post: 3 Jul 2007, 4:35 PM

Tags for this Thread

Posting Permissions

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