Mayank Sahu Mayank Sahu - 1 year ago 75
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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download