Mastering Ext JS 2nd Edition Learn how to develop advanced and efficient Internet applications with Ext JS Loiane Groner - Download the ebook now to start reading without waiting
Mastering Ext JS 2nd Edition Learn how to develop advanced and efficient Internet applications with Ext JS Loiane Groner - Download the ebook now to start reading without waiting
https://ebookfinal.com/download/ext-js-in-action-second-edition-jesus-
garcia/
https://ebookfinal.com/download/ext-js-in-action-1st-edition-jesus-
garcia/
https://ebookfinal.com/download/mastering-d3-js-1st-edition-pablo-
navarro-castillo-castillo/
https://ebookfinal.com/download/node-js-for-php-developers-porting-
php-to-node-js-1st-edition-daniel-howard/
https://ebookfinal.com/download/node-js-novice-to-ninja-craig-buckler/
https://ebookfinal.com/download/restful-web-api-design-with-node-js-
second-edition-bojinov/
https://ebookfinal.com/download/coffeescript-programming-with-jquery-
rails-and-node-js-1st-edition-michael-erasmus/
Loiane Groner
BIRMINGHAM - MUMBAI
www.it-ebooks.info
Mastering Ext JS
Second Edition
All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy
of the information presented. However, the information contained in this book
is sold without warranty, either express or implied. Neither the author nor Packt
Publishing, and its dealers and distributors will be held liable for any damages
caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
ISBN 978-1-78439-045-7
www.packtpub.com
www.it-ebooks.info
Credits
Reviewers Proofreaders
Peter Holcomb Simran Bhogal
Girish Srivastava Maria Gould
Thorsten Suckow-Homberg Paul Hindle
Copy Editor
Sarang Chari
www.it-ebooks.info
About the Author
Loiane has worked at multinational companies, such as IBM. Her areas of expertise
include Java SE and Java EE and also Sencha technologies (Ext JS and Sencha
Touch). Nowadays, Loiane works as a software development manager at a financial
institution, where she manages overseas solutions. She also works as an independent
Sencha consultant and coach.
Loiane is also the author of Ext JS 4 First Look, Mastering Ext JS, Sencha Architect App
Development, and Learning JavaScript Data Structure and Algorithms, all published by
Packt Publishing.
She is passionate about Sencha and Java; she is a leader of Campinas Java Users
Group (CampinasJUG) and a coordinator of Espirito Santo Java Users Group
(ESJUG), both Brazilian JUGs.
Loiane also contributes to the software development community through her blogs,
http://loianegroner.com (English) and http://loiane.com (Portuguese-
BR), where she writes about IT careers, Ext JS, Sencha Touch, PhoneGap, Spring
Framework, and general development notes, as well as publishing screencasts.
www.it-ebooks.info
Acknowledgments
I would like to thank my parents for giving me education, guidance, and advice all
these years and helping me to become a better human being and professional. A
very special thanks to my husband for being patient and supportive and giving
me encouragement.
I also would like to thank the readers of this book and the other books I have written,
for their support and feedback. Your feedback is very valuable to me to improve as
an author and as a professional. Thank you very much!
www.it-ebooks.info
About the Reviewers
Peter Holcomb has been working with Ext JS for several years, right from version
2, and has thoroughly enjoyed being a part of the Sencha community as it has grown.
A tinkerer at heart, Peter tries to spend his free time on a variety of projects to keep
his skills sharp and stay on top of new frameworks and technologies. He's currently
a lead frontend engineer at SailPoint Technologies, Inc., a company that he's been
fortunate to be a part of for over 8 years. He lives in Austin with his wife, Courtney,
and two children and thoroughly enjoys breakfast tacos.
www.it-ebooks.info
Thorsten Suckow-Homberg is a software developer from Aachen, Germany.
He took his first programming steps with AmigaBASIC, peeked into Turbo Pascal,
Modula-3, and learned to love the strange yet wonderful abstract world of object-
oriented programming (OOP) with Java. Most of the time, he works on PHP/
JavaScript-driven web applications, such as conjoon.com, of which he is the main
developer. If he's not traveling around teaching JavaScript and Ext JS, you'll most
likely find him in the woods, riding his mountain bike, or sitting in front of his desk,
sipping coffee and engineering code.
www.it-ebooks.info
www.PacktPub.com
Did you know that Packt offers eBook versions of every book published, with PDF
and ePub files available? You can upgrade to the eBook version at www.PacktPub.
com and as a print book customer, you are entitled to a discount on the eBook copy.
Get in touch with us at service@packtpub.com for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign
up for a range of free newsletters and receive exclusive discounts and offers on Packt
books and eBooks.
TM
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital
book library. Here, you can search, access, and read Packt's entire library of books.
Why subscribe?
• Fully searchable across every book published by Packt
• Copy and paste, print, and bookmark content
• On demand and accessible via a web browser
www.it-ebooks.info
Table of Contents
Preface 1
Chapter 1: Sencha Ext JS Overview 7
Understanding Sencha Ext JS 7
Architecture of Ext JS applications 8
Ext JS overview 9
Basic tutorial 9
Class system 9
Components 10
The component hierarchy 10
GridPanel 11
TreePanel 12
Forms 12
Other components 13
Layouts 13
Data package 14
The MVC and MVVM architectures 14
Look and feel of Ext JS applications 15
Installing Ext JS 15
Prerequisites for Ext JS and Sencha Cmd 15
Downloading Ext JS and Sencha Cmd 17
Offline documentation 18
IDE 20
Summary 20
Chapter 2: Getting Started 21
Preparing the development environment 21
Presenting the application and its capabilities 24
The splash screen 25
The login screen 25
www.it-ebooks.info
Table of Contents
[ ii ]
www.it-ebooks.info
Table of Contents
[ iii ]
www.it-ebooks.info
Table of Contents
[ iv ]
www.it-ebooks.info
Table of Contents
[v]
www.it-ebooks.info
Table of Contents
[ vi ]
www.it-ebooks.info
Preface
If you are an Ext JS developer, it probably took you a while to learn the framework.
We know that the Ext JS learning curve is not short. After we have learned the basics,
and we need to use Ext JS in our daily jobs, a lot of questions pop up: how can one
component talk to another? What are the best practices? Is it really worth using this
approach and not another one? Is there any other way I can implement the same
feature? This is normal.
So this is what this book is about: how do we put everything together and create
really nice applications with Ext JS? We are going to create a complete application,
from the mockup of the screens all the way to putting it into production. We
are going to create the application structure, a splash screen, a login screen, a
multilingual capability, an activity monitor, a dynamic menu that depends on user
permission, and modules to manage database information (simple and complex
information). And then, we will learn how to build the application for production,
how to customize the theme, and how to debug it.
We will use real-world examples and see how we can implement them using Ext JS
components. And throughout the book, we've also included a lot of tips and best
practices to help you boost your Ext JS knowledge and take you to the next level.
www.it-ebooks.info
Preface
Chapter 3, The Login Page, explains how to create a login page with Ext JS and how
to handle it on the server side and also shows some extra capabilities, such as adding
the Caps Lock warning message and submitting the login page when pressing the
Enter key.
Chapter 4, The Logout and Multilingual Capabilities, covers how to create the logout
capability and also the client-side activity monitor timeout, which means if the
user does not use the mouse or press any key on the keyboard, the system ends
the session automatically and logs out. This chapter also provides an example of
multilingual capability and shows how to create a component so that the user can
use it to change the system's language and locale settings.
Chapter 5, Advanced Dynamic Menu, is about how to create a dynamic menu that
depends on user permission. The options of the menu are rendered depending on
whether the user has permission or not; if not, the option will not be displayed.
Chapter 6, User Management, explains how to create a screen to list all the users that
already have access to the system.
Chapter 7, Static Data Management, covers how to implement a module where the
user is able to edit information as though they were editing information directly
from a MySQL table. This chapter also explores capabilities such as live search, filter,
and inline editing (using the Cell Editing and Row Editing plugins). Also, we start
exploring real-world issues when we develop big applications with Ext JS, such as
the reuse of components throughout the application.
Chapter 9, Adding Extra Capabilities, covers how to add features, such as printing and
the ability to export to PDF and Excel, that are not supported natively by Ext JS. This
chapter also covers charts and how to export them to image and PDF and also how
to use third-party plugins.
[2]
www.it-ebooks.info
Preface
Chapter 10, Routing, Touch Support, and Debugging, demonstrates how to enable
routing in the project; it is also about debugging Ext JS applications, including what
we need to be careful about and why it is very important to know how to debug.
We also quickly talk about transforming Ext JS projects into mobile apps (responsive
design and touch support), a few helpful tools that can help you in your daily work
as a developer, and also a few recommendations of where to find extra and open
source plugins to use in Ext JS projects.
Chapter 11, Preparing for Production and Themes, covers how to customize a theme
and create custom UIs. It also explores the steps required for, and the benefits of,
packaging the application to production.
• Xampp: http://www.apachefriends.org/en/xampp.html
• MySQL: http://dev.mysql.com/downloads/mysql/
• MySQL Workbench: http://dev.mysql.com/downloads/tools/
workbench/
• MySQL Sakila sample database: http://dev.mysql.com/doc/index-
other.html and http://dev.mysql.com/doc/sakila/en/index.html
For Sencha Cmd and the required tools, use the following:
[3]
www.it-ebooks.info
Preface
• Compass: http://compass-style.org/
• Java JDK (version 7 or later): http://www.oracle.com/technetwork/java/
javase/downloads/index.html
• Java environment variables: http://docs.oracle.com/javase/tutorial/
essential/environment/paths.html
• Apache ANT: http://ant.apache.org/bindownload.cgi
• Apache ANT environment variable: http://ant.apache.org/manual/
install.html
• And of course, Ext JS: http://www.sencha.com/products/extjs/
Conventions
In this book, you will find a number of text styles that distinguish between different
kinds of information. Here are some examples of these styles and an explanation of
their meaning.
Code words in text, database table names, folder names, filenames, file extensions,
pathnames, dummy URLs, user input, and Twitter handles are shown as follows:
"If we want to create a class to represent the client details, we could name it
ClientDetails."
When we wish to draw your attention to a particular part of a code block, the
relevant lines or items are set in bold:
Ext.application({
name: 'Packt',
extend: 'Packt.Application',
[4]
www.it-ebooks.info
Preface
autoCreateViewport: 'Packt.view.main.Main'
});
New terms and important words are shown in bold. Words that you see on the
screen, for example, in menus or dialog boxes, appear in the text like this: "Scroll
until the end of the page and select OPEN SOURCE GPL LICENSING."
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about
this book—what you liked or disliked. Reader feedback is important for us as it helps
us develop titles that you will really get the most out of.
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 at www.packtpub.com/authors.
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.
[5]
www.it-ebooks.info
Discovering Diverse Content Through
Random Scribd Documents
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookfinal.com