Working with Store
So far, we saw how to define and create a model and use it to populate a form. There are various other components which work with a collection of models that need to be saved in a store. In this recipe, we will look at the steps required to define a store and use it to contain models and populate the data in a component.
Getting ready
Make sure that you have set up your development environment by following the recipes outlined in Chapter 1.
How to do it...
Carry out the following steps:
- Create and open a new file named
ch05_03.js
and paste the following code into it:Ext.setup({ onReady: function() { Ext.regModel('User', { fields: [ {name: 'name', type: 'string'}, {name: 'age', type: 'int'}, {name: 'phone', type: 'string'}, {name: ...
Get Sencha Touch Cookbook 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.