Pregunta

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?

¿Fue útil?

Solución

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();
}

Otros consejos

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top