Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User Mis63's Avatar
    Join Date
    Aug 2010
    Location
    Clermont-Ferrand, France
    Posts
    42
    Vote Rating
    0
    Mis63 is on a distinguished road

      0  

    Default [FIXED] Invalid id for records loaded from local storage

    [FIXED] Invalid id for records loaded from local storage


    Sencha Touch version tested:
    • 1.0.1
    Platform tested against:
    • Safari
    Description:
    • When a store using a LocalStorageProxy is loaded, its records do not contain the correct id. Instead of having the id present in the local storage, a auto generated id is assigned.
    • So next, the getId function of record and the indexOfId function of store do not behave as expected.
    Possible fix:
    • The problem seems to be in the getRecord function of WebStorageProxy class : when the record is instantiated, the id is not passed to the constructor.
    By changing the line 9204 of sencha-touch-debug.js
    Code:
    record = new Model(data);
    with the below line where content in blue is added
    Code:
    record = new Model(data, id);
    it works fine.

  2. #2
    Sencha - Community Support Team edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    9
    edspencer is a jewel in the rough edspencer is a jewel in the rough edspencer is a jewel in the rough

      0  

    Default


    Thanks, I've applied your fix to the 1.0.x branch - it'll appear in the next release
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

Similar Threads

  1. Local Storage
    By tomalex0 in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 20 Dec 2010, 6:24 AM
  2. Saving List data to local storage
    By Akhenaten in forum Sencha Touch 1.x: Discussion
    Replies: 6
    Last Post: 19 Dec 2010, 5:36 PM
  3. [FIXED-587] Records loaded marked dirty
    By omarc in forum Sencha Touch 1.x: Bugs
    Replies: 2
    Last Post: 22 Nov 2010, 6:03 PM
  4. Replies: 2
    Last Post: 3 Jun 2010, 10:53 AM
  5. idea: local storage using Flash Shared objects
    By PromaneX in forum Community Discussion
    Replies: 0
    Last Post: 2 Jun 2008, 4:53 AM

Thread Participants: 1