Handling Scroll Events
When the scrolling is enabled on a component in Sencha Touch, the framework fires the scroll related events that we use to scroll the content. This recipe lists out the scroll related events and shows how to handle them.
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:
- Add the following handler functions inside the
Ext.onReady
inch09_01.js
:this.handleScrollEvent = function(e) { console.log('scroll'); } this.handleScrollstartEvent = function(e) { console.log('scrollstart'); } this.handleScrollendEvent = function(e) { console.log('scrollend'); }
- Set
scroll: 'vertical'
property to the panel initialization:var ...
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.