Skip to content

Instantly share code, notes, and snippets.

Created July 11, 2013 19:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5978322 to your computer and use it in GitHub Desktop.
Save anonymous/5978322 to your computer and use it in GitHub Desktop.
Ext.define('MyApp.store.ClientStore', {
extend: 'Ext.data.Store',
config: {
model: 'MyApp.model.Client',
storeId: 'clientStore',
sorters: [
{ property: 'ClientName', direcion: 'ASC' }
],
listeners: {
beforeload: function(store){
store.setProxy({
type: 'ajax',
url: 'http://www.myapp.local/services/GetClients',
headers: {
'Content-Type': 'application/json'
},
extraParams: {
filterString: Ext.ComponentQuery.query('searchformfield')[0].getValue()
},
actionMethods: {
read: "POST"
},
reader: {
type: 'json',
rootProperty: 'GetClientsResult'
},
writer: {
type: 'json',
encodeRequest: true
}
});
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment