July 2015
Beginner
452 pages
8h 34m
English
Models represent objects or entities inside our application, for example, Clients, Users, Invoices, and so on. Those models will be used by the data stores. We can define as many models as we need inside our application.
A model may contain fields, validations, and relationships between other models. We can also set a proxy to persist and pull our data.
As of version 5.x, field definitions can be optional unless you need conversion, validations, or set an implicit data type. For more information, take a look at http://docs.sencha.com/extjs/5.1/whats_new/5.0/whats_new.html#Models.
To create a model, let's write the following code:
Ext.define('Myapp.model.Client',{
extend:'Ext.data.Model', // step 1
idProperty:'clientId ', // step 2
fields:[ ...Read now
Unlock full access