O'Reilly logo

Ext JS 4 Web Application Development Cookbook by Stuart Ashworth, Andrew Duncan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Handling events on elements and components

Ext JS is an event driven framework and so it is important to be able to listen for raised events and react to them to control the flow of your application. These events could be raised through user interaction, for example, a button being clicked or keyboard keys being pressed, or internally within the framework, for example a store being loaded with data or a component being hidden.

In this recipe, we will explain how to listen for components' events and execute code when they are raised.

We will start off by listening for a simple click event on an element to explain the syntax and composition of an event handler. We will then move on to alternative ways of defining listeners.

Getting ready

We will set ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required