- Sencha Touch Tutorial
- Sencha Touch - Home
- Sencha Touch - Overview
- Sencha Touch - Environment
- Sencha Touch - Naming Convention
- Sencha Touch - Architecture
- Sencha Touch - MVC Explanation
- Sencha Touch - First App
- Sencha Touch - Build Application
- Sencha Touch - Migration Steps
- Sencha Touch - Core Concepts
- Sencha Touch - Data
- Sencha Touch - Theme
- Sencha Touch - Device Profile
- Sencha Touch - Dependencies
- Environment Detection
- Sencha Touch - Events
- Sencha Touch - Layout
- Sencha Touch - History & Support
- Sencha Touch - Upload & Download
- Sencha Touch - View Components
- Sencha Touch - Packaging
- Sencha Touch - Best Practice
- Sencha Touch Useful Resources
- Sencha Touch - Quick Guide
- Sencha Touch - Useful Resources
- Sencha Touch - Discussion
Sencha Touch - Store
It is basically the collection of model instances. Stores can be static and dynamic as well. In a static store, we load data inline. In dynamic store, we fetch data from the server using ajax proxies.
Store base class is Ext.data.Store
Static Store
Ext.create('Ext.data.Store', { model: 'User', data: [ { firstName: 'Greg', lastName: 'Barry' }, { firstName: 'Seth', lastName: 'Lemmons' }, { firstName: 'Mitch', lastName: 'Simoens' }, { firstName: 'Fred', lastName: 'Mosby' } ] });
In store, we can perform sorting, filtering, and grouping of store data locally as well as remotely.
To perform sorting locally, we define the sorter and the field, based on which we need to sort the data.
Filter in key value pair as property be your field name and value be your value to be filtered.
Grouping can be performed with groupField in which we provide a field name based on which the grouping has to be done.
groupDir is to specify the direction - ascending or descending.
Ext.create('Ext.data.Store', { model: 'User', sorters: ['name', 'id'], filters: { property: 'name', value : 'Ed' }, groupField: 'age', groupDir: 'DESC' });
sencha_touch_data.htm
Advertisements
To Continue Learning Please Login
Login with Google