Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Basically you did nothing wrong, but the reason is sencha touch uses asynchronous loading and it seems that <code>Ext.getStore()</code> is not instantiated at the time your store is defined.</p> <p>Let's try this method instead:</p> <p>First, add a listener for <code>beforeload</code> event inside your store config:</p> <pre><code>Ext.define('MyApp.store.Post',{ extend:'Ext.data.Store', config: { model: 'MyApp.model.Post', proxy: { type: 'ajax', //url: you don't even need to set url config here, simply ignore it reader: { type: 'json' } } }, listeners: [ { fn: 'setUrl', event: 'beforeload' } ] }); </code></pre> <p>then declare a function like this, in the same file:</p> <pre><code>setUrl: function(){ this.getProxy().setUrl(Ext.getStore('UserData').getAt(0).data.userid); return true; } </code></pre> <p>This way, it's ensured to set the url for your store's proxy right before it's loaded. And basically at the time, all core methods are instantiated.</p> <p><strong>Update: please try this with your Post store:</strong></p> <pre><code>Ext.define('MyApp.store.Post',{ extend:'Ext.data.Store', config: { //autoLoad: true, fields: ['title', 'link', 'author', 'contentSnippet', 'content'], proxy: { type: 'jsonp', url: 'dummy url', reader: { type: 'json', rootProperty: 'responseData.feed.entries' } }, }, initialize: function(){ console.log("loaded!"); this.getProxy().setUrl('https://ajax.googleapis.com/ajax/services/feed/load?v=1.0&amp;q=http://feeds.feedburner.com/SenchaBlog'); //return true; } }); </code></pre> <p><strong>After reading the source code of the pull-to-refresh plugin, I see that Sencha Touch use an <code>Ext.data.Operation</code> instead of <code>Ext.data.Store.load()</code> function. So you will have to put it into the <code>initialize</code> method instead.</strong> </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload