문제

I'm implementing dragging and dropping of list items in a Dojo mobile app. I use dojo.gesture.tap.hold to initiate the dragging. However, the page scrolls when you start dragging.

The list is inside a ScrollableView.

Is there a way to deactivate scrolling while dragging?

도움이 되었습니까?

해결책

Sigh, I found the answer. Get a hold on the ScrollableView, override the onBeforeScroll event handler and return a boolean to indicate whether the view should scroll or not.

Example:

var scrollView = dijit.registry.byId("myScrollableView");
scrollView.onBeforeSCroll = function(evt) {
  return shouldTheViewScroll();
}

다른 팁

You can also set the disableTouchScroll attribute of the ScrollableView to true/false as needed. This is not documented (and yes that should be fixed), but it should work.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top