如何在点击并按住时在 ui-grid 中移动列?
How can I do column move in ui-grid on tap & hold?
如何在点击并按住 ui-grid 时移动列?
我正在使用 ui-grid 触摸设备,因此需要通过点击并按住网格列来移动列 header,有没有人知道如何解决这个问题。
嗨,Mayank,你可以这样做。
animateElement(function(evt)
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(){
movableFn(lastTouchEvent);
};
var touchStart = function(event){
lastTouchEvent = event;
touchTimer = setTimeout(onlongtouch, touchduration);
};
var touchEnd = function(event){
if(touchTimer){
clearTimeout(touchTimer);
touchTimer = null;
return;
}
};
希望对你有用。
如何在点击并按住 ui-grid 时移动列?
我正在使用 ui-grid 触摸设备,因此需要通过点击并按住网格列来移动列 header,有没有人知道如何解决这个问题。
嗨,Mayank,你可以这样做。
animateElement(function(evt)
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(){
movableFn(lastTouchEvent);
};
var touchStart = function(event){
lastTouchEvent = event;
touchTimer = setTimeout(onlongtouch, touchduration);
};
var touchEnd = function(event){
if(touchTimer){
clearTimeout(touchTimer);
touchTimer = null;
return;
}
};
希望对你有用。