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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:26:29+00:00 2026-05-28T08:26:29+00:00

My Setup Safari 5.1.2 (Macintosh) Sencha Touch 1.1 The Issue The process I have

  • 0

My Setup

  • Safari 5.1.2 (Macintosh)
  • Sencha Touch 1.1

The Issue

The process

I have a model and a store. I update a record using the set(field,value) method documented here: API – Set. After updating fields, I use save() method documented here: API – Save.

The Result

The record updates in any lists that are bound to the store and appears to be saved, however when I reload the webpage the old values are displayed. So the record is updated, the store see’s the new data, the lists bound to the store refresh their display, but the actual representation of the data in localstorage is never updated. If you use the browser console to find and inspect the item with something like var record = summaryStore.getAt(4), you will find that the dirty attribute is false even if the save() call has not been made. Also summaryStore.getUpdatedRecords() returns an empty set regardless of whether the save() method has been called.

Further documentation

API – Models

API – Stores

API – Proxies

The Code

Store

var summaryStore = new Ext.data.Store({
model: 'EventSummary',
storeId: 'summaryStore',
sortOnLoad: true,
sorters: [
    {
        property: 'date',
        direction: 'DESC'
    }
],
proxy: {
    type: 'localstorage',
    id  : 'summary-cache'
}
})

Model

Ext.regModel('EventSummary', {
fields: [
    {name: 'child', type: 'string'},
    {name: 'date', type: 'date'},
    {name: 'description', type: 'string'},
    {name: 'event_id', type: 'int'}
],
proxy: summaryStore.proxy
})

Example

var record = summaryStore.findExact('event_id', 90)
record.date = new Date();
record.description = 'Vitamin K Shot`
record.save()

Both before and after the record.save(), the dirty flag is false. summaryStore.getUpdatedRecords() returns an empty set both before and after the save. All lists to summary store reflect the change made regardless of whether the record is saved.

Additional Notes

The store is populated with this call, which follows the declaration of the store and the model. summaryStore.load()

  • 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-28T08:26:30+00:00Added an answer on May 28, 2026 at 8:26 am

    Update

    The issue can be avoided altogether by properly instantiating your model instances before passing them to the store’s add method. I was just passing in JSON, which the store accepted, but apparently was causing issues.

    End Update

    The issue can be fixed by making changes in WebStorageProxy.js

    Be advised that changing this file does not modify your sencha-touch.js file. You will have to rebuild it or modify it directly

    This code was not working

    setRecord: function(record, id) {
        if (id) {
            record.setId(id);
        } else {
            id = record.getId();
        }
    

    This line in particular id = record.getId(); for some reason was coming up undefined on objects that had already been added to the store. The solution is to add

    if (id === undefined) {
        id = record.internalId;
    }
    

    The final code looks like

    setRecord: function(record, id) {
        if (id) {
            record.setId(id);
        } else {
            id = record.getId();
            if (id === undefined) {
                id = record.internalId;
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have setup my form using CSS.. Labels float to the left and input/textareas
I have a like box setup in my website using the following code as
SETUP: Using Google Apps Script's UI (doGet) with tabPanel option. At the bottom of
Setup I am using custom Forms Authentication - all standard stuff. In the Login
What is the simplest/most-streamlined setup for testing apps in all of todays browsers? Safari
I have the following jsfiddle setup: http://jsfiddle.net/zZDqH/ Currently it is just a button that
If you have ever used a new release of either Chrome or Safari, you
I have this Visual Studio 2010 Setup Project for installing my application. On (clean)
I am trying to set up simple Cross-Origin Resource Sharing using jQuery (1.7.1) powered
I have setup some code on JSFiddle. The jQuery :contains selector works fine in

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.