July 2015
Beginner
452 pages
8h 34m
English
After adding, editing, or modifying records into the store, we should send the data to our server. Ext JS allows us to do this by the use of a writer property (it has to set in the proxy). This writer will encode the data depending on the type of writer (JSON or XML). In order to archive this, let's create the CustomersSending.js file in the path appcode/store/customers. We will use the previous models we have created and place the following code:
Ext.define('Myapp.store.customers.CustomersSending',{
extend:'Ext.data.Store',
model: 'Myapp.model.Customer',
autoLoad:false,
autoSync:true,
proxy:{
type:'ajax',
url: 'serverside/customers.json',
api: {
read : 'serverside/customers.json',
create : 'serverside/process.php?action=new',Read now
Unlock full access