CREATE STORE IN EXTJS

Pawan Shukla

Total Post:38

Points:274
Posted by  Pawan Shukla
Sencha 
 752  View(s)
Ratings:
Rate this:
I am try to create a store in extjs. but i don't know how to create please help me any one.
  1. aditya kumar Patel

    Post:254

    Points:1810
    Re: Create Store In extjs

    The Store class encapsulates a client side cache of Model objects. Stores load data via a Proxy, and also provide functions for sortingfiltering and paging the model instances contained within it.

    Creating a Store is easy - we just tell it the Model and the Proxy to use for loading and saving its data:

    var Store=Ext.define('MyApp.store.Users', {
        extend: 'Ext.data.Store',  
        model: 'MyApp.model.User',
        proxy: {
            type: 'ajax',
            url: '/api/dashboard',        
            reader: {
                type: 'json',
                root: 'Users',
                totalProperty: 'TotalCount'
            }
        },
        remoteSort: true,
        sorters: [{
            property: 'UserName',
            direction: 'asc'
        }],
        autoLoad: { start: 0, limit: 5 },
        pageSize: 5,
    });

    Thanks.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!