1. #1
    Sencha User froamer's Avatar
    Join Date
    Sep 2007
    Location
    London, UK
    Posts
    96
    Vote Rating
    0
    froamer is on a distinguished road

      0  

    Default Pull to Refresh leaves deleted items

    Pull to Refresh leaves deleted items


    Hi, I am using the really cool Pull to Refresh plugin for my List.

    My model has idProperty set to a field that is unique.

    If I add new records to the database they appear, if I modify records the changes appear but if I delete a record it remains in the list.

    Is this a bug or am I doing something wrong?
    Chris Copleston » Managing Director | LinkedIn | Twitter | SenchaDevs
    4dprime.com » web | mobile | desktop | server development

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    34,107
    Vote Rating
    453
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    When you removed a record, did you sync() the store to send a request to the backend to remove it from the database (or whatever)?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    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 almost in print!

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

  3. #3
    Sencha User froamer's Avatar
    Join Date
    Sep 2007
    Location
    London, UK
    Posts
    96
    Vote Rating
    0
    froamer is on a distinguished road

      0  

    Default


    Hi Mitchell, thanks for the reply. Much appreciated!

    I deleted the record from the backend database (not the store). I then pulled to refresh expecting the deleted records to be removed from the list. New and modified records are picked up but the deleted records remain in the list.

    Should I do something with the store when the user Pulls to Refresh (reload it perhaps) or should that happen automatically?

    Thanks again.
    Chris Copleston » Managing Director | LinkedIn | Twitter | SenchaDevs
    4dprime.com » web | mobile | desktop | server development

  4. #4
    Sencha User froamer's Avatar
    Join Date
    Sep 2007
    Location
    London, UK
    Posts
    96
    Vote Rating
    0
    froamer is on a distinguished road

      0  

    Default


    Bump - is this expected behaviour or should I post this as a bug?
    Chris Copleston » Managing Director | LinkedIn | Twitter | SenchaDevs
    4dprime.com » web | mobile | desktop | server development

  5. #5
    Sencha User
    Join Date
    Jul 2012
    Posts
    4
    Vote Rating
    1
    justinmc is on a distinguished road

      0  

    Default


    I noticed this as well, after thinking it must be my code's problem for the longest time. I don't know if this is a bug or not, but I got it to do what you and I seem to want by adding this

    Code:
    store.load();
    to PullRefresh.js in the fetchLatest function, around line 175. Seems to correctly add and remove entries now.

  6. #6
    Sencha User
    Join Date
    May 2012
    Posts
    1
    Vote Rating
    0
    ubul87 is on a distinguished road

      0  

    Default


    According to the sources of pullrefresh this is the expected behaviour.

    However I would also like to see the functionality to remove deleted items.

Tags for this Thread