Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Good question. I assume you are trying to build a List or dataview. The key here is to give your store a 'storeId'. I have modified your store below:</p> <pre><code>Ext.define('FirstApp.store.StudentStore',{ extend:'Ext.data.Store', config:{ storeId: 'Students', // Important for view binding and global ref autoLoad:true, model:'FirstApp.model.people', sorters: 'lastName', proxy:{ type:'ajax', url:'http://xxxyyyzzz.com/data/dummy_data.json', reader:{ type:'json', rootProperty:'results' } } } }); </code></pre> <p>Then inside your view, you reference the store to bind to. Here is an example List view from one of my applications. Notice the config object has 'store' which references our above store:</p> <pre><code>Ext.define('app.view.careplan.CarePlanTasks', { extend: 'Ext.dataview.List', xtype: 'careplanTasks', requires: [ 'app.view.template.CarePlan' ], config: { store: 'Students', // Important! Binds this view to your store emptyText: 'No tasks to display', itemTpl: Ext.create('app.view.template.CarePlan'), }, constructor : function(config) { console.log('CarePlan List'); this.callParent([config]); } }); </code></pre> <p>Now that you have a storeId, you can access this store anywhere in your application by doing the following:</p> <pre><code>Ext.getStore('Students') </code></pre> <p>You can load records from your server by calling the load method as well:</p> <pre><code>Ext.getStore('Students').load(); </code></pre> <p>You can do this anywhere in your application, but typically it's best to do in your controllers.</p> <p>Hope this helps.</p> <p>======= Updates to your updates ======</p> <p>So looking at your code I think you need to modify your List view and the controller. Give 'FirstApp.view.MainPanel' an xtype: 'MainPanel'. Next modify your controller config as follows:</p> <pre><code>config: { profile: Ext.os.deviceType.toLowerCase(), stores : ['StudentStore'], models : ['people'], refs: { mainPanel: 'MainPanel', // set the object KEY to the name you want to use in the control object and set the VALUE to the xtype of the view placesContainer:'placesContainer' }, control: { 'mainPanel': { // this matches the key above, which points to your view's xtype activate: 'onActivate', itemtap: 'onItemTap' // listen for the item tap event on this List }, 'mainPanel searchfield[itemId=searchBox]' : { clearicontap : 'onClearSearch', keyup: 'onSearchKeyUp' }, 'placesContainer places list':{ itemtap:'onItemTap' } } }, </code></pre>
    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.
 

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