1. #11
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,555
    Vote Rating
    814
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    remove is working for me on 1.1.0 and removes only that record in local storage.

    You can do a search in the forum and you may see some overrides floating around I made to fix certain bugs in removing.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  2. #12
    Sencha User
    Join Date
    Apr 2011
    Posts
    1
    Vote Rating
    0
    C.S. is on a distinguished road

      0  

    Default


    K I'm a little confused by this thread - but it is the first result in google and is EXACTLY the problem I am experiencing atm.

    I have Sencha Touch 1.1.0 loaded in Chrome 10 (desktop - for some initial dev work) and as it was records were not getting removed from the Local Storage.

    I am actually using this project that I have modified to run over normal web sockets.

    I hadn't even touched the Ext.Store chunks of code, but now I'm having to add this 'id' field to the store structure - which does indeed magically fix the remove/sync abilities.

    So is it "as designed" that an 'id' field must be present for the store to function properly or is there a problem in 1.1.0 that still needs to be fixed?

    (Or is that demo project just designed bass-ackwards to begin with maybe?)

  3. #13
    Sencha User
    Join Date
    Dec 2011
    Posts
    8
    Vote Rating
    0
    sonic555gr is on a distinguished road

      0  

    Default


    Hello!
    It's been a year since the last response to this thread. I am having a different kind of problem with the localstorage. The removal of items from local storage works fine but after i remove the last item the local storage becomes unusable.

    In chromes debugger i see the local storage populated with 1 key for the proxy lets say that the proxy's id is
    'favoritesOffersProxy' after i add an item with id 57 i get 2 records. One that is the proxy and another that is the record. After i remove the record the proxy gets deleted also, so the local storage gets unusable and i have to refresh the page to initialize my proxy again... does anyone have any idea how to resolve this?

    this is my store
    Code:
    app.stores.FavoritesOffersStore = new Ext.data.Store({
        id:'favoritesOffersStore',
        model:app.models.OffersModel,
        autoLoad:true,
        proxy: 
        {
            id:'favoritesOffersProxy',
            type: 'localstorage'
        }});
    and i delete a record like this

    Code:
    app.stores.FavoritesOffersStore.remove(item);
    app.stores.FavoritesOffersStore.sync();
    If you have any questions about what exactly i'm talking about, don't hesitate to contacte me!

    Thank you!

  4. #14
    Sencha User
    Join Date
    Jan 2013
    Posts
    1
    Vote Rating
    0
    sixin is on a distinguished road

      0  

    Default


    Quote Originally Posted by chummy View Post
    It works for me if I add a field called "id" of type "int" to the model. Sencha Touch will populate the field. It seems, from having a quick look at the code, that Sencha Touch uses this field to identify the instance of the record that it must delete from the store.
    thanks this works for me

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] Invalid id for records loaded from local storage
    By Mis63 in forum Sencha Touch 1.x: Bugs
    Replies: 1
    Last Post: 13 Dec 2010, 10:45 AM
  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: 8