O'Reilly logo

Ext JS 4 Web Application Development Cookbook by Stuart Ashworth, Andrew Duncan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Loading and saving a Model using proxies

Another huge advantage of the new Ext.data.Model class is that it is capable of saving and loading its own data without having to be attached to a data store.

This means that we can create new data objects anywhere within our code and easily send them to the defined URL to be saved by the server. This results in much less code and duplication, which is always a good thing!

This recipe will show this piece of functionality in action, building on our Book model that was used in previous recipe.

Getting ready

This recipe requires a running web server. There are four PHP files (which are supplied) that will be used for loading data into our Model.

How to do it...

  1. We start by defining our Model. We will use the Book ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required