title: Sencha Touch 2 list/store
body: <p>I have a problem with an list-component on the sencha touch 2 framework. My problem is, that my list doesn't show the calculated distance between the current position and the places.<br>
  First I use an navigation view with a list (name + distance) when the user click the name more details about them appears (+ the back-button will generated automatic). If the back-button is pressed the list shows the correct distance in the list. But I really need the distance is shown at the first time. I tried a lot but nothing helps.
  I use a model and a store:</p>
  
  <pre><code>    'Ext.define('Guide.store.ProjekteList', {
       extend: 'Ext.data.Store',
  
      config:{
          model: "Guide.model.ProjekteList", 
          autoLoad:true, 
          sorters: ['distance'],
          storeId: 'ProjekteList',
          proxy: {
             type: 'ajax',
             url : 'PHP/get_MainList.php',
             reader: {
                type: 'json', 
                rootProperty:'items'
             }
         },
         listeners: {
             load : function(){
                     this.each(function(store){
                         var newData = getDis(store.data);
                     });//each                    
              }//load func
          }// listener
      }//config
  });// klasse
  
  var getDis = function(dataset) {
      var geo = Ext.create('Ext.util.Geolocation', {
      autoUpdate: false,
      listeners: {
          locationupdate: function(geo) {
             polat = geo.getLatitude(); 
             polng = geo.getLongitude();  
             var B1 = dataset.Lat / 180 * Math.PI; 
             var B2 = polat / 180 * Math.PI;
             var L1 = dataset.Lng / 180 * Math.PI;
             var L2 = polng / 180 * Math.PI;
             var zwi = Math.acos(Math.sin(B1)*Math.sin(B2)     + Math.cos(B1)*Math.cos(B2)*Math.cos(L2-L1));  
             var r = 6378.137; //km
             dataset.distance  =  r * zwi;
             dataset.distance = Math.round(dataset.distance*100)/100; 
  
           },
          locationerror: function(geo, bTimeout, bPermissionDenied, bLocationUnavailable, message) {
              if(bTimeout){
                  alert('Timeout occurred.');
              } else {
                  alert('Error occurred.');
              }
          }
      }
  });
  geo.updateLocation();
   return dataset;
  
  };' 
  </code></pre>
  
  <p>and my model:</p>
  
  <pre><code>'Ext.define('Guide.model.ProjekteList', {
       extend: 'Ext.data.Model',  
  
       config: {
           fields:  ['Projektname', 'Lat', 'Lng', 'distance', 'ID'],
       }
   });
  </code></pre>
  
  <p>here is my navigation view:</p>
  
  <pre><code>'Ext.define('Guide.view.ProjekteList', {
  extend: 'Ext.navigation.View', 
  
  xtype: 'projektelist',
  
  config: {
  
          title: 'Orte',
          iconCls:'Projekte' , 
          id: 'listButton',
  
  
          items:[
  
          { 
              xtype: 'list', 
              onItemDisclosure: true, 
          /*  plugins: [
                      {
                          xclass: 'Ext.plugin.ListPaging',
                          autoPaging: false,
  
                      }
                  ], */   
              title: 'Sehenswerte Orte',  
                  store: 'ProjekteList',
              itemId: 'liste',
              itemTpl: '&lt;h2&gt;{Projektname}&lt;/h2&gt; Entfernung: {distance} km',    
              listeners: {
                             show: function(){  
  
                                     this.refresh();   
  
                               } //show function
              }, //listeners 
         } // item
        ] //items 
  }// config 
  
  }); ' 
  </code></pre>
  
  <p>and my controller</p>
  
  <pre><code> Ext.define("Guide.controller.ProjekteList", {
  extend: "Ext.app.Controller",
  
  views: ['ProjektList'],
  
  config: {
  
          refs: {  
              projekt: 'projektelist',
  
          },
          control: {
              'projektelist list': {
                  itemtap: 'showDetail'
              }   
          }                          
      },
      showDetail: function(list, index, element, record) {    
          var projektid = record.get('ID');  
  
  Ext.StoreMgr.get('ProjektDetail').setProxy({url:'PHP/get_Detail.php?
  ID='+projektid}).load();    
           this.getProjekt().push({  
           xtype: 'projektdetails', 
           });  
  
      }  //     showDetail function 
  
  }); 
  </code></pre>
  
  <p>Thanks in advance!     </p>