Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7437387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:23:32+00:00 2026-05-29T10:23:32+00:00

In ST1.x I had no problem syncing an onlinestore to an offlinestore with the

  • 0

In ST1.x I had no problem syncing an onlinestore to an offlinestore with the below method, now it seems that sync doesn’t work in STB2. I can see the records being output on the console. Anyone else having this issue? I believe it may be a bug…

var remoteStore = Ext.getStore('UpdateConfig');
var localStore = Ext.getStore('UpdateLocalConfig');

remoteStore.each(function (record) {
    localStore.add(record.data);
    console.log(record.data);
});
localStore.sync();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:23:33+00:00Added an answer on May 29, 2026 at 10:23 am

    This was answered on the Sencha Touch 2 Forums by TommyMaintz, but I wanted to give the answer here as well.

    “One thing I think I see which is wrong is that you are adding a record to the LocalStore using the record.data. In ST2 we now have a Model cache. This means that if you create two instances with the exact same model and id, the second time you create that instance it will just return the already existing instance. This means that if you sync your local store, it won’t recognize that record as a ‘phantom’ record because it already has an id. What you would have to do in your case if you want to make a “copy” of your record by using all the data but removing the id. This will generate a new simple id for it and when you save it to your local storage it will generate a proper local id for it.

    When I tried doing this I noticed the “copy” method on Model hasn’t been updated to handle this. If you apply the following override you should be able to do localStore.add(record.copy()); localStore.sync()”

    Ext.define('Ext.data.ModelCopyFix', {
        override: 'Ext.data.Model',
    
        /**
         * Creates a copy (clone) of this Model instance.
         *
         * @param {String} id A new id. If you don't specify this a new id will be generated for you.
         * To generate a phantom instance with a new id use:
         *
         *     var rec = record.copy(); // clone the record with a new id
         *
         * @return {Ext.data.Model}
         */
        copy: function(newId) {
            var me = this,
                idProperty = me.getIdProperty(),
                raw = Ext.apply({}, me.raw),
                data = Ext.apply({}, me.data);
    
            delete raw[idProperty];
            delete data[idProperty];
    
            return new me.self(null, newId, raw, data);
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having an update statament in my jsp. The problem is that when
I have two space separated strings... (the X doesn't mean the same symbol) st1
I'm having two problems with my program. The code below generates two panels when
I'm trying to build a MySQL query that uses the rows in a lookup
I have a C# app that hits a couple of different databases to do
I am trying to write a program that works as an intermedium. (M) I
Have following code: public interface ITest { string St1 { get; } } public
I have a simple set of states like this: st1 = [(x, 2), (y,
I have a question, now i have two classes as following public class mainClass
If I have: string st1 = this.is.a.string.type; string st2 = string; Is there any

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.