Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Store/List not reloading Sencha 1.1.1

I've got a phonegap-wrapped sencha touch (v1.1.1) app that has a few stores, and a list.

The problem occurs after you're logged in as "User1", and then log out and log back in as "User2". The list won't refresh with the new account data fetched by the store proxy.

I'm currently attempting to call .refresh() on the List itself, which according to the docs will also cause the store to refresh its data (although, I'm manually doing that before hand anyway)

var sL = Ext.getCmp('AccountsList');
sL.refresh();
sL.scroller.scrollTo({x:0,y:0});

We've also tried to .sync() the stores with no results.

Ext.getStore('AccountsTransfersTo').sync();
Ext.getStore('AccountsTransfersFrom').sync();
Ext.getStore('AccountsStore').sync();

Any idea what the problem is, or has anyone run into something similar?

like image 587
ahren Avatar asked Nov 25 '13 15:11

ahren


1 Answers

refresh won't reload the store, it just grabs whatever is in the store and re-renders the view.

sync is for updating the store when you've got local changes and you're posting them to the server.

You need to call the load method on the store.

like image 67
Evan Trimboli Avatar answered Sep 20 '22 05:09

Evan Trimboli