sencha touch 2 - local storage data not in view -
i'm making webapp sencha touch 2 (with architet) , have problem local storage: data isn't in view.
if check how "rows" has storage return 4 (correct!), on view records not displayed.
can me?
(settings not interact products, therefore, ignore it!)
app.js:
ext.application({ models: [ 'products', 'settings' ], stores: [ 'settings', 'products' ], views: [ 'settings', 'homepage', 'productslist' ], controllers: [ 'main' ], name: 'youpazzle', launch: function() { ext.create('youpazzle.view.settings', {fullscreen: true}); }});
controller:
ext.define('youpazzle.controller.main', { extend: 'ext.app.controller', config: { }, launch: function() { var settings = ext.getstore('settings'); if(settings.data.all.length === 0){ console.log('settagglio non eseguito'); }else{ console.log('settagglio eseguito'); this.gotohomepage(); } }, gotohomepage: function() { //ext.viewport.add(firststep); // reverse slide direction before using setactiveitem() var topage = ext.create('youpazzle.view.homepage'); ext.viewport.setactiveitem(topage); } });
model:
ext.define('youpazzle.model.products', { extend: 'ext.data.model', config: { fields: [ { name: 'codice' }, { name: 'obj' } ] }});
storage:
ext.define('youpazzle.store.products', { extend: 'ext.data.store', requires: [ 'youpazzle.model.products' ], config: { autoload: true, autosync: true, model: 'youpazzle.model.products', storeid: 'products', proxy: { type: 'localstorage' } }});
view:
ext.define('youpazzle.view.productslist', { extend: 'ext.dataview.dataview', config: { itemid: 'productslist', store: 'products', itemtpl: [ '<div>data view item {codice}</div>' ], items: [ { xtype: 'toolbar', docked: 'top', title: 'prodotti', items: [ ] } ] } initialize: function() { }});
change view code
itemtpl: '<div>data view item {codice}</div>',
Comments
Post a Comment