This recipe talks about four touch specific events: touchstart
, touchdown
, touchmove
, and touchend
and also explains how to handle them.
Make sure that you have set up your development environment by following the recipes outlined in Chapter 1.
Create a new folder named ch09
in the same folder where we created the ch01
and ch02
folders. We will be using this new folder in which to keep the code.
Carry out the following steps:
Create and open a new file named
ch09_01.js
and paste the following code into it:Ext.setup({ onReady: function() { this.handleEvent = function(e) { console.log(e.type); } var pnl = new Ext.Panel({ id:'main-panel', fullscreen: true, monitorOrientation: true, layout: 'fit', defaults: { border: false } }); var touchPnl = Ext.getCmp('main-panel'); touchPnl.mon(touchPnl.el, { touchstart: this.handleEvent, touchend...