Create Store In extjs
2938
05-Oct-2016
I am try to create a store in extjs. but i don't know how to create please help me any one.
Updated on 05-Oct-2016
Anonymous User
05-Oct-2016The Store class encapsulates a client side cache of Model objects. Stores load data via a Proxy, and also provide functions for sorting, filtering 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.