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 8212351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:43:37+00:00 2026-06-07T10:43:37+00:00

What I’m trying to do: To let the user be able to store data

  • 0

What I’m trying to do:

To let the user be able to store data locally until he decides to upload it all. To achieve this, I am filling the data from a form into a model and then filling a store (sync) with this model. This store has a local storage proxy.
offlineStore.js:

Ext.define('blahblah.store.offlineStore',{
extend:'Ext.data.Store',
config:{
    model:'blahblah.model.myModel',
    id: 'offlineRegisterStore',
    sorters:'xyz',
    grouper:function(record){
        return record.get('xyz')[0];
    },
    proxy: {
        type: 'localstorage',
        id: 'offlineRegisterStoreid'
    }
 ...

Now, when the user presses the sync button, I copy data from this offline store, to another store having a proxy that does the REST call:
OnlineStore:

   Ext.define('blahblah.store.upStore', {
     extend: 'Ext.data.Store',
     config: {
        model: 'blahblah.model.myModel',
        id: 'abc',
        sorters: 'xyz',
        grouper: function (record) {
          return record.get('xyz')[0];
        },
        proxy: {
        type: 'rest',
        url: HOST,
        headers: HEADERS,
        reader: {
            type: 'json'

        },
        writer: {
            type: 'json'
        }
    ...

The Problem:

Unfortunately, my online store is not even executing store.sync() after I add data from the offline store into it. As a result of which, no REST call is made. I realize that this happens when the store has unchanged data being synced. This was odd since I had added nothing to the online store prior to copying data into it from the offline store.

So I did a console.log on the online store right after I created it. I saw that this store already has the form data filled in it. And, I’m guessing this is why sync() is not executed, since I’m adding this same data back into it, just this time, from the offline store. I’m puzzled about how and from where did this online store get its data.
I also tried store.removeAll() before I added anything from the offline store into the online store but it had no effect on the store content.

Do tell if you need to see more code.

Edit 1: How I’m filling the the offline store- I create an instance of my model, fill it up with the form data and execute offlineStore.add(myModel). After this I do offlineStore.sync(). This is how I fill my model with data:

var myModel = Ext.create('blahblah.model.myDataModel',{  
    datafield1 = formdata1,
    datafield2 = formdata2
});  

At what point do I check the online store:
When the user clicks the submit button of the form, I get the offline store and create online store. Surprisingly, I just observed that not only the online store, but even the offline store has the form data right when I getStored it. So basically the data enters the offline and online store even before I execute sync() on them or add the data-filled model? This confuses me even more.

  • 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-06-07T10:43:39+00:00Added an answer on June 7, 2026 at 10:43 am

    Finally found a solution to my problem from the Sencha forums: setting record.phantom = true.

    Before adding a record to the online store (from the offline store) I executed the above piece of code. Now, when the store synced, it considered the freshly added record as indeed a new record, and thus did the POST request.

    I must also add that if you instead set record.dirty = true, then the store sent a PUT request instead of the POST.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have some data like this: 1 2 3 4 5 9 2 6
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I am trying to render a haml file in a javascript response like so:
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.