O'Reilly logo

Sencha Touch 2 Mobile JavaScript Framework by Bryan P. Johnson, John Earl Clark

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

Building the SavedPhotos components

Our SavedPhotos components will need to store the information for a single photo from our search results. We will also need a list view for our saved photos and a details view, just like our previous SearchPhotosList and SearchPhotoDetails models.

Creating the SavedPhotos store

Since our SavedPhotos and SearchPhotos components are storing the same type of data, we don't need to create a new model. We can just use our Photo.js model. However, we do need a separate data store, one that will store our Photo model locally.

Let's create a new file called SavedPhotosStore.js in our app/store folder and add the following code:

Ext.define('FlickrFindr.store.SavedPhotosStore', { extend: 'Ext.data.Store', requires: 'FlickrFindr.model.Photo', ...

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