Results 1 to 10 of 13

Thread: Best practices to save user settings locally

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Sencha User
    Join Date
    Feb 2012
    Vote Rating


    Quote Originally Posted by mrsunshine View Post
    you can check the count of the store and work with a record with the same ID, should be only one record in the store. so if no record exist create one otherwise work with the existing one
    I'm doing this, but notice that if I check the Resources tab in Chrome's Developer Tools under LocalStorage -> localhost, I can see that there are entries for both 'myUniqueProxy' and 'myUniqueProxy-0' (I set the id to the model to be 0).

    There are never any more entries in 'myUniqueProxy-0' other than the one I want, however it looks like there are tons entries for '0' in 'myUniquProxy'. Apparently one for every save despite it being the same record.

    Here's an image of what I'm seeing (don't pay attention to any malformed data, I modified it for this post):


    My proxy is setup like this:
            proxy : {
                type : 'localstorage',
                id : 'myUniqueProxy',
    My Model has an id field like this:
                name : 'id',
                type : 'integer',
                defaultValue : 0,
                isUnique : true
    Then just like you said, I call for the store to getRecordById(0), update that record with current data and save it.

    Am I doing something wrong to get so many entries in the 'myUniqueProxy' entry?

    Thanks in advance for any advice.

    Last edited by bwags; 19 Jun 2012 at 7:48 AM. Reason: Added image

Tags for this Thread

Posting Permissions

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