Book Image

Mastering Ext JS

By : Loiane Groner
Book Image

Mastering Ext JS

By: Loiane Groner

Overview of this book

<p>Ext JS 4 is a JavaScript framework that provides you with the resources to build multi-browser, high-performance, and rich Internet applications.<br /><br />Mastering Ext JS is a practical, hands-on guide that will teach you how to develop a complete application with Ext JS. You’ll begin by learning how to create the project’s structure and login screen before mastering advanced level features such as dynamic menus and master-detail grids, before finally preparing the application for production.<br /><br />Mastering Ext JS will help you to utilize Ext JS to its full potential and will show you how to create a complete Ext JS application from the scratch, as well as explaining how to create a Wordpress theme.</p> <p><br />You will learn how to create user and group security, master-detail grids and forms, charts, trees, and how to export data to excel including PDF and images, always focusing on best practices.</p> <p><br />You will also learn how to customize themes and how to prepare the application to be ready for deployment upon completion. Each chapter of the book is focused on one task and helps you understand and master an individual aspect of the application.</p> <p><br />By the end of the book, you will have learned everything you need to know to truly master Ext JS and to start building advanced applications.</p>
Table of Contents (20 chapters)
Mastering Ext JS
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
Index

Creating the models


As usual, we are going to start by creating the models. First, let's list the tables we will be working with and their columns:

  • Actor: actor_id, first_name, last_name, last_update

  • Category: category_id, name, last_update

  • Language: language_id, name, last_update

  • City: city_id, city, country_id, last_update

  • Country: country_id, country, last_update

We could create one model for each of these entities with no problem at all, however, we want to reuse as much code as possible. Take another look at the list of tables and their columns. Notice that all tables have one column in common, the last_update column.

As all the tables have the last_update column in common we can create a super model, and then in models (which will extend the super model we do not need to declare the column) don't you think?

Abstract model

In OOP (Object Oriented Programming) there is a concept called inheritance, which is a way to reuse the code of existing objects. Ext JS uses an OOP approach, so...