Mayank Sahu Mayank Sahu - 10 months ago 49
AngularJS Question

How can I do column move in ui-grid on tap & hold?

How can I do column move in ui-grid on tap & hold?

I am using ui-grid for touch devices, so it requires to move columns by tap & hold on grid column header, is anyone has idea how to overcome this problem.

Answer Source

Hi Mayank you can do something like this way.

        grid.scrollContainers($scope.$parent.containerId, scrollEvent, evt);

element.on('touchstart', touchStart);
element.on('touchend', touchEnd);

var lastTouchEvent;
var touchduration = 500;
var touchTimer;

var onlongtouch = function(){

var touchStart = function(event){
    lastTouchEvent = event;
    touchTimer = setTimeout(onlongtouch, touchduration);

var touchEnd = function(event){
       touchTimer = null;

I hope it works for you.