Creating the Quotation model
First, you want to build a store, but let's build a model before that (source file: 02_creating_quotation_model/app/model/Quotation.js
).
Let's implement the Quotation
model class that has a newly acquired id
, customer
, modified
and created
.
Define the id
, customer
name
, modified date/time
, and created date/time
parameters. Then, we'll implement the store that was used in the model in the previous step (source file: 02_creating_quotation_model/app/store/Quotation.js
).
Ext.define('MyApp.store.Quotation', { extend: 'Ext.data.Store', storeId: 'QuotationList', model: 'MyApp.model.Quotation', remoteSort: true, pageSize: 100, proxy: { type: 'direct', directFn: 'MyAppQuotation.getGrid', reader: { type: 'json', root: 'items', totalProperty: 'total' } } });
Specify MyAppQuotation.getGrid
in directFn
. This is the method name where the store is going to acquire the data. Of course...