View Full Version : json list auto update

24 Aug 2012, 4:41 AM
hey guys, im creating an app and using twitter as my experiment for it.

i have a main panel view which holds a list, this list gets populated by a store which is working with a model.

i also have a controller which has an action so that when i press a button it fires off a recursive ajax request, to get the constant twitter feed of a specified account.

what i want my application to do is for it to display any changes made to in my twitter account and automatically update on my application without having to restart the whole app.

i check the browser's console and im recieving the data, i just need a way for it to be displayed onto my view/list

what would be the best way to acheive this, should i add the new json data into my store? and what is the way to re-render the view, im a bit stuck on this part

any help would be much appreciated

26 Aug 2012, 5:55 AM
Is your store getting the data? Is your store the one loading the data?

28 Aug 2012, 12:41 AM
yes the store is getting the data and loading the data, i want it similar to the pull refresh plugin thats available, but without the need to pull the screen down to refresh the page. but for the app to be watching out for any updates.

28 Aug 2012, 4:03 AM
all you have to do is execute store.load() whenever you want to load new data and the list will automatically update

28 Aug 2012, 4:16 AM
i did that but it always gives me an error saying that the load() method is undefined.

28 Aug 2012, 5:14 AM
or i get this error

Main.js:184 (http://localhost/controltweet/app/controller/Main.js?_dc=1346159473556)

Uncaught Error: [ERROR][Ext.data.proxy.Server#destroy] JsonP proxies can only be used to read data

28 Aug 2012, 5:16 AM
Are you using store.sync() or store.load()?

28 Aug 2012, 5:21 AM

28 Aug 2012, 5:45 AM
You must be doing something else along the way as store.load() has worked perfectly for me in many occasions.

28 Aug 2012, 5:57 AM
i have it connected up to a button which has an ajax request, which will call itself after 5 seconds, this is located in the controller.

but im nearly there because when i use store.load its trying to do what i want but falls apart at the last point.

have you seen the pull refresh plugin ? , that is the almost the perfect functionality that i need but without having to pull down to refresh page.

29 Aug 2012, 7:01 AM
thanks for you help, you were right, i managed to get store.load() working, i was just getting the store it self completely wrong. 8-|