Results 1 to 3 of 3

Thread: [OPEN-766]Loading JSON and saving to LocalStorage does not persist Association Fields

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Apr 2010
    Location
    Cupertino, Ca
    Posts
    247

    Default [OPEN-766]Loading JSON and saving to LocalStorage does not persist Association Fields

    Sencha 1.0.1
    Google Chrome


    I have a nested JSON object I load into a Ext.Store with a memory Proxy.
    I then loop through all models and their known associated models and call the save() method
    These models all have a local storage Proxy.
    When saved, all models have their explicit fields and values stored in localStorage.
    However, there is no foreign key field saved in localStorage.

    I would expect that the implicit foreign key field would be saved to localStorage.

    When I first load the stores using the defined json fixture, the stores maintain the associations and I can traverse these relationships. However, when I attempt to load from local storage, I can not traverse these relationships.

  2. #2
    Sencha User
    Join Date
    Apr 2010
    Location
    Cupertino, Ca
    Posts
    247

    Default

    Ahh, when I explicitly listed the foreign key field within the models fields definitions it was persisted in local storage.

    Its strange that it worked on first load when everything was in memory.

    I could see a validation check on models being useful here. Maybe when a belongsTo association is created it checks that a field definition exists for the foreignKey name belonging to that association.

  3. #3
    Sencha User
    Join Date
    Apr 2010
    Location
    Cupertino, Ca
    Posts
    247

    Default

    Maybe a feature request, but for a less "repetitive" style, maybe belongsTo associations can automatically update the fields list with a field named the same name as the foreign_key, defaulting to type:'integer' unless specified otherwise.

Similar Threads

  1. Loading Multiple Models by Association using Store
    By babar.sajjad in forum Sencha Touch 1.x: Discussion
    Replies: 3
    Last Post: 31 Mar 2011, 6:56 AM
  2. Problem in saving Form values to LocalStorage
    By ajaytaksali in forum Sencha Touch 1.x: Discussion
    Replies: 0
    Last Post: 18 Jan 2011, 12:31 PM
  3. Replies: 1
    Last Post: 21 Nov 2010, 4:00 PM
  4. Replies: 11
    Last Post: 6 Mar 2008, 8:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •