Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: json list auto update

  1. #1
    Sencha User
    Join Date
    Aug 2012
    Posts
    11
    Vote Rating
    0
      0  

    Default json list auto update

    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

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Vote Rating
    1272
      0  

    Default

    Is your store getting the data? Is your store the one loading the data?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Aug 2012
    Posts
    11
    Vote Rating
    0
      0  

    Default

    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.

  4. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Vote Rating
    1272
      0  

    Default

    all you have to do is execute store.load() whenever you want to load new data and the list will automatically update
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  5. #5
    Sencha User
    Join Date
    Aug 2012
    Posts
    11
    Vote Rating
    0
      0  

    Default

    i did that but it always gives me an error saying that the load() method is undefined.

  6. #6
    Sencha User
    Join Date
    Aug 2012
    Posts
    11
    Vote Rating
    0
      0  

    Default

    or i get this error



    Main.js:184


    • [COLOR=red !important]Uncaught Error: [ERROR][Ext.data.proxy.Server#destroy] JsonP proxies can only be used to read data

    [/COLOR]

  7. #7
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Vote Rating
    1272
      0  

    Default

    Are you using store.sync() or store.load()?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  8. #8
    Sencha User
    Join Date
    Aug 2012
    Posts
    11
    Vote Rating
    0
      0  

    Default

    store.load();

  9. #9
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Vote Rating
    1272
      0  

    Default

    You must be doing something else along the way as store.load() has worked perfectly for me in many occasions.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  10. #10
    Sencha User
    Join Date
    Aug 2012
    Posts
    11
    Vote Rating
    0
      0  

    Default

    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.

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •