Book Image

Ext JS Application Development Blueprints

Book Image

Ext JS Application Development Blueprints

Overview of this book

Table of Contents (18 chapters)
Ext JS Application Development Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Storing the data


The stores in this project are as simple as it can be:

// app/store/LogEntries.js
Ext.define('Instrumatics.store.LogEntries', {
    extend: 'Ext.data.Store',
    alias: 'store.logentries',
    model: 'Instrumatics.model.LogEntry',
    autoLoad: true,
    remoteFilter: true
});

// app/store/LogStream.js
Ext.define('Instrumatics.store.LogStream', {
    extend: 'Ext.data.Store',
    alias: 'store.logstream',
    model: 'Instrumatics.model.LogStream',
    autoLoad: true,
    remoteFilter: true
});

// app/model/Statistics.js
Ext.define('Instrumatics.store.Statistics', {
    extend: 'Ext.data.Store',
    alias: 'store.statistics',
    model: 'Instrumatics.model.Statistic'
});

These classes are fairly boilerplate (define the model, define the alias, and that's it). There's an argument to be heard that these stores could actually be defined on individual view models, reducing the number of files in our code base. However, in this application, we'll reuse the stores in multiple view...