Book Image

Ext JS Application Development Blueprints

Book Image

Ext JS Application Development Blueprints

Overview of this book

Table of Contents (18 chapters)
Ext JS Application Development Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

The generation game


From here, we can quickly build out the skeleton of our application. The key MVVM classes are controllers, models, and views (with their associated view controllers and view models). Sencha Cmd can assist with quickly creating all of these classes.

Note

The generation of code using a command-line tool is often known as "scaffolding" and was popularized by Ruby On Rails. For more on the subject, refer to http://en.wikipedia.org/wiki/Scaffold_(programming).

For controllers, it's simple:

sencha generate controller MyController

The preceding command produces:

// app/controller/MyController.js
Ext.define('MyApp.controller.MyController', {
    extend: 'Ext.app.Controller'
});

Then, the model generator invoked looks like this:

sencha generate model MyModel fullName:string,age:int

MyModel is the name of the model straightforward. The next parameters allow generation of fields in the model (provided as a comma-separated list of name:type field pairs). In this case, we're creating...