Handling Drag Events

When an element is dragged on the screen, the framework gives us different events to indicate that the drag has started, the item is on the move, and the drag has ended. In this recipe, we will look at the drag specific events.

Getting ready

Make sure that you have set up your development environment by following the recipes outlined in Chapter 1.

How to do it...

Carry out the following steps:

  1. Add the following code after the component reference is retrieved using the Ext.getCmp method:
                dragstart: this.handleEvent,
                drag: this.handleEvent,
                dragend: this.handleEvent,
  2. Deploy and access it from the device of your choice.

Get Sencha Touch Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.