To save the picture in the application's folder ,we need to implement the store and model of the picture and some logic.
The picture model itself is very simple. Let's create it and put it under app/model/Picture.js
:
Ext.define('Imaginary.model.Picture', { extend: 'Ext.data.Model', config: { fields: [ { name: 'id', type: 'int' }, { name: 'url', type: 'string' } ] } });
Where:
id
is the generated identifier inlocaStorage
url
is the path to the picture on the device
The store is a little different than the one for effects. Let's add the following lines of code in the app/store/Pictures.js
file:
The Pictures.js
store, is as follows:
Ext.define('Imaginary.store.Pictures',{ extend:'Ext.data.Store', requires: ['Ext.data.proxy.LocalStorage', 'Imaginary.model.Picture'], config:{ model:'Imaginary.model.Picture', storeId: 'Pictures...