Book Image

Ext JS 4 Plugin and Extension Development

By : Abdullah Al Mohammad
Book Image

Ext JS 4 Plugin and Extension Development

By: Abdullah Al Mohammad

Overview of this book

Ext JS is a pure JavaScript application framework for building interactive web applications using techniques such as Ajax, DHTML, and DOM scripting. Ext JS 4 Plugin and Extension Development is a practical, step-by-step tutorial which guides you to learn and develop ExtJS plugins and extensions. There are a lot of examples with explanations and plenty of code provided to make it easier and quicker to pick up. Starting with the fundamentals, this book introduces some of the ExtJS library and community provided plugins and extensions and finishes with several hands-on, real world development examples. You will get a clear concept of ExtJS plugins and extensions and learn how to use them. You will also learn how to develop an ExtJS plugin and extension by going through several examples with code and screenshots. Ext JS 4 Plugin and Extension Development book will provide you with the knowledge to develop ExtJS plugins and extensions using real-life examples.
Table of Contents (16 chapters)
Ext JS 4 Plugin and Extension Development
About the Author
About the Reviewers


In this modern world of JavaScript, Ext JS offers a vast collection of cross-browser utilities, a great collection of UI widgets, charts, data object stores, and much more. When developing an application, we mostly look for the best support for the functionality and components that offer the framework. But we almost always face the situation when the framework does not have the specific functionality or component that we need. Fortunately, Ext JS has a powerful class system that makes it easy to extend an existing functionality or component, or to build new functionalities or components.

In this book, we start by providing a very clear concept of Ext JS plugins and extensions with examples, going through several Ext JS libraries and community-provided plugins and extensions and several hands-on developments of real-life, useful Ext JS plugins and extensions.

What this book covers

Chapter 1, Plugins and Extensions, introduces and defines the Ext JS plugins and extensions, the differences between them, and shows how to develop a plugin and an extension with examples.

Chapter 2, Ext JS-provided Plugins and Extensions, introduces some of the very useful and popular plugins and extensions available within the Ext JS library.

Chapter 3, Ext JS Community Extensions and Plugins, introduces some of the popular Ext JS community extensions and plugins.

Chapter 4, Labeled Spinner, goes through hands-on development of an Ext JS extension called Labeled spinner field. This chapter shows how we can extend the Ext.form.field.Spinner class, and add functionality so that this extension can show a configurable label beside the value within the spinner field and some more advanced features.

Chapter 5, Chart Downloader, goes through hands-on development of an Ext JS plugin, which will help to download a chart as an image. This plugin will generate a button that, when it is clicked, will perform the required functionality so that the plugin container's chart item can be downloaded as an image.

Chapter 6, Grid Search, goes through hands-on development of an Ext JS plugin, which will provide a search facility within a grid. This plugin was originally developed by Ing. Jozef Sakáloš and is a very useful and popular plugin. In this chapter, this plugin will be re-written for the Ext JS 4x Version.

Chapter 7, Input Field with ClearButton, goes through hands-on development of Stephen Friedrich's ClearButton plugin. This plugin is targeted for the text components that show a "clear" button over the text field. When the clear button is clicked, the text field is set to empty.

Chapter 8, Message Bar, goes through hands-on development of an Ext JS extension, which will be a fancy animated message bar. The message bar will provide the facility of having a configurable duration timer for showing the message, a close button, and also be able to customize the look, and can provide optional icons for different types of states such as valid or invalid, or information during runtime.

Chapter 9, Intuitive Multi-select Combobox, explores an excellent Ext JS extension, BoxSelect, which was originally developed by Kevin Vaughan. This extension is really very useful and provides a friendlier combobox for multiple selections, which creates easy and individually removable labels for each selection and lots more.

What you need for this book

The examples in this book use the Ext JS 4.1.3 SDK, available from the Ext JS website at

Who this book is for

The book is aimed at web application developers who are familiar with the basics of Ext JS and want to build custom Ext JS plugins and extensions. Experienced Ext JS developers can also increase their skills in the field of Ext JS plugins and extensions.


In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "we will extend the Ext.form.field.Spinner class which will add functionality".

A block of code is set as follows:

onSpinUp : function() {

onSpinDown : function() {

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "we can find the Get value button within the window".


Warnings or important notes appear in a box like this.


Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at If you purchased this book elsewhere, you can visit and register to have the files e-mailed directly to you.


Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from


Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.


You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.