O'Reilly logo

Learning Ext JS - Fourth Edition by Armando Gonzalez, Crysfel Villa, Carlos A. Méndez

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

Creating a module

Before we create the customer module, we are going to reuse the code written in Chapter 7, Give Me the Grid. To be more precise, we are going to use the code made in example 07 and make slight changes. First, for the model, we'll use the following code:

Ext.define(' myApp.model.Customer',{
  extend: 'Ext.data.Model',
  requires:  ['myApp.model.Contract'], idProperty: 'id', fields: [ {name: 'id', type: 'int'}, {name: 'name', type: 'string'}, {name: 'phone', type: 'string'}, {name: 'website', type: 'string'}, {name: 'status', type: 'string'}, {name: 'clientSince', type: 'date', dateFormat: 'Y-m-d H:i'}, {name: 'country', type: 'string'}, {name: 'sendnews', type: 'boolean'}, {name: 'employees', type: 'int'}, {name: 'contractInfo', reference: ...

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