Book Image

Mastering ExtJS - Second Edition

By : Loiane Avancini
Book Image

Mastering ExtJS - Second Edition

By: Loiane Avancini

Overview of this book

Table of Contents (19 chapters)
Mastering Ext JS Second Edition
About the Author
About the Reviewers

Using the responsive design plugin

Another new capability introduced in Ext JS 5 is the option to develop responsive applications. Mobile devices are part of our lives. We basically have a computer in our pockets. It is very common nowadays to have tablet or mobile compatible as an item listed in a user requirements document. Fortunately, Ext JS 5 provides good support and allows us to achieve this requirement without too much effort.

Ext JS 5 introduces the responsive plugin and mixin. The plugin can be used in any component, and the mixin can be used in any other class. This plugin responds dynamically to changes in screen size and orientation by controlling responsiveConfig.

For example, let's do a quick example in our project. If the width of the screen is less than 768 pixels and the screen is in tall mode, we are going to hide the application menu and display a new button that is going to render the menu as displayed in the following screenshot:

In the Packt.view.main.Main class, we are...