In the last three recipes, we saw the usage of the different types of client-side proxies, which help us persist the data on the client browser. Now, we will see how to work with the server proxies to persist the data on a remote server.
In this recipe, we will see what it takes to use AjaxProxy
to persist and load models.
Make sure that you have set up your development environment by following the recipes outlined in Chapter 1.
Carry out the following steps:
Create and open a new file named
ch05_12.js
and paste the following code into it:Ext.setup({ onReady: function() { Ext.regModel('User', { fields: [ {name: 'name', type: 'string'}, {name: 'age', type: 'int'}, {name: 'phone', type: 'string'}, {name: 'email', type: 'string'}, {name: 'alive', type: 'boolean', defaultValue: true} ] }); var store = new Ext.data.Store({ model: 'User', autoLoad...