Sencha Touch models have the ability to work with a proxy. This feature allows you to save and retrieve model data from the server, memory or local storage, without depending on a Sencha Touch data store.
The model methods you will learn in this article are the following:
- save
- erase
Let’s try them with a very simple scenario where the server side is a PHP page. In this example you will create a simple Sencha Touch application with the following files:

In the model/Hotel.js file, you will define the Hotel model like so:
Ext.define('App.model.Hotel', {
extend: 'Ext.data.Model',
config: {
fields: [
{ name: 'id', type: 'int' },
{ name: 'name', type: 'string' },
{ name: 'address', type: 'string' },
{ name: 'status', type: 'int' }
],
proxy: {
type: 'ajax',
api: {
create: '../../services/hotels.php?act=createhotel',
read: '../../services/hotels.php?act=loadhotel',
update: '../../services/hotels.php?act=updatehotel',
destroy: '../../services/hotels.php?act=erasehotel'
},
reader: {
rootProperty:'hotels'
}
}
}
});











