1. #1
    Sencha User
    Join Date
    Sep 2011
    Posts
    13
    Vote Rating
    0
    Nuthan Santharam is on a distinguished road

      0  

    Default Answered: store not removing the desired data

    Hi There,

    I have implemented sencha touch 2 sqlite proxy https://github.com/shepsii/SQLite-Proxy-ST2 .
    I am trying to delete the locally stored data after its usage, but the results are strange. I have just gathered part of the code.

    Code:
    record object passed into my controller function
    {"id":13,"url":"abcdxyz/1354356455113.jpg","album_id":"6","xindex":1}
    
    var store=Ext.getStore('MyStore');
    
    store.removeAt(record.xindex);
    //trying to remove the index-not working, actually removes some random row/object.
    store.remove(record)
    //trying to remove the record itself-not working
    store.sync();
    Please help!!!

  2. could you try:
    Code:
    store.removeAt(1);
    and:
    Code:
    store.remove(store.getById(record.id));

  3. #2
    Sencha User
    Join Date
    Nov 2012
    Location
    Netherlands
    Posts
    50
    Vote Rating
    1
    Answers
    6
    eastlander is on a distinguished road

      0  

    Default

    could you try:
    Code:
    store.removeAt(1);
    and:
    Code:
    store.remove(store.getById(record.id));

  4. #3
    Sencha User
    Join Date
    Sep 2011
    Posts
    13
    Vote Rating
    0
    Nuthan Santharam is on a distinguished road

      0  

    Default problem persists

    Thanks for the reply, the problems still persists. It removes the record sometimes, but doesn't work at times. Wondering, what might be the problem!!!!

    Thanks,
    Nuthan

  5. #4
    Sencha User
    Join Date
    Sep 2011
    Posts
    13
    Vote Rating
    0
    Nuthan Santharam is on a distinguished road

      0  

    Default its working

    Code:
    store.remove(store.getById(record.id)
    did the trick...

    I commented the loading of store
    Code:
    Ext.getStore('MyStore').load();
    Thanks eastlander

Thread Participants: 1

Tags for this Thread