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: ...

Get Learning Ext JS - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.