1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    8
    Vote Rating
    0
    priya@ceptes.com is on a distinguished road

      0  

    Default Unanswered: How to save ajax proxy store data in localproxy

    Unanswered: How to save ajax proxy store data in localproxy


    Need some help to save Ext.Store data in localstorage which connects to extrenal system (using rest webservice api).

  2. #2
    Sencha User
    Join Date
    Oct 2011
    Posts
    2
    Vote Rating
    0
    shakilbharucha is on a distinguished road

      0  

    Default


    you will need to download the data into the ajax store and then move the same into the offline store once the the online store is loaded

    In the example below the inv.models.NewsData is my model and should me a model for both online and offline store.

    Also your component should point to the the offlineStore.

    Code:
    inv.stores.NewsData = new Ext.data.Store({
        model: 'inv.models.NewsData',
        proxy: {
            type: 'scripttag',
            url: 'http://query.yahooapis.com/v1/public/yql',
            extraParams: {            format: 'json'        },
              reader: {
                  root: 'query.results.Results.RNSSummaries.RNSSummary'
              }
          }});
    
    this.offlineStore= new Ext.data.Store({
                  model: 'inv.models.NewsData',
                  proxy: new Ext.data.LocalStorageProxy({
                      id:'data', 
                     proxy:{idProperty:'RNSId'}
                  }), 
                 autoLoad: true,
                  autoSave: true 
             });
    
    this.inv.stores.NewsData.on('load',function(store,records,opts){
                      console.log("load from online"); 
                     this.offlineStore.proxy.clear(); 
                     this.inv.stores.NewsData.each(function (record){
                          var iconEach = this.offlineStore.add(record.data)[0];
                      },this);
                      this.offlineStore.sync();
                      console.log("loaded from online");
                 },this);

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi