Scroll speed when dragging columns

If I have a grid with a lot of columns, when I try to reposition a column by dragging it to an area off the viewable screen are, the scroll speed is painfully slow.

Anyone know of a way to improve the speed?

Thanks in advance, Chris


1 Reply

DM Dineshnarasimman Muthu Syncfusion Team August 16, 2023 01:55 PM UTC

Hi Chris Tate-Davies,


Greetings from Syncfusion Support.


After reviewing your query, we understood that you need to increase the horizontal scroll speed when performing column reorder. The requirement is achieved by overriding the internal method updateScrollPostion() in the created event of the grid and set the interval to increase the scroll speed. The code snippet and sample have been attached for your reference.


 

function created() {

  ej.grids.Reorder.prototype.updateScrollPostion = function (e) {

    var _this = this;

    var x = ej.grids.getPosition(e).x;

    var cliRect = this.parent.element.getBoundingClientRect();

    var cliRectBaseRight = cliRect.right;

    if (this.parent.isFrozenGrid()) {

      this.updateFrozenScrollPosition(xcliRect);

    } else {

      var cliRectBaseLeft = cliRect.left;

      var scrollElem_1 = this.parent.getContent().firstElementChild;

      if (x > cliRectBaseLeft && x < cliRectBaseLeft + 35) {

        this.timer = window.setInterval(function () {

          _this.setScrollLeft(scrollElem_1true);}, 5);   //changing the interval to 5 to increase the scroll speed

      } else if (x < cliRectBaseRight && x > cliRectBaseRight - 35) {

        this.timer = window.setInterval(function () {

          _this.setScrollLeft(scrollElem_1false);  }, 5);//changing the interval to 5 to increase the scroll speed

      }

    }

  };

}

 


Sample: https://stackblitz.com/edit/8rardh-xohxrd?file=index.js


Please let us know if you need any further assistance.


Regards,

Dineshnarasimman


Loader.
Up arrow icon