O'Reilly logo

Ext JS 4 First Look by Loiane Groner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The new model class

A Model represents an entity, an object; it is a set of functions and fields to operate the data. This new class is very similar to the Record class (Ext JS 3 and previous versions), which allowed us to create fields and functions to operate the data. The Model class is more powerful; you can create several models and link them through Associations, you can use Validations to validate your data, and you can also load the data directly using a Proxy inside a Model. The following diagram exemplifies all the capabilities of the Model class:

The new model class

Declaring fields

To create a Model, you simply need to use Ext.define to define a new class, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required