1. #1
    Sencha User
    Join Date
    Apr 2013
    Posts
    22
    Answers
    1
    Vote Rating
    0
    montalbano is on a distinguished road

      0  

    Default Answered: Listview refresh does not work

    Answered: Listview refresh does not work


    Hello,

    I'm having a listview which is coupled to a store (localstorage). If I delete an item out of the store and return back to the listview, the deleted item is not visible anymore. This works fine using Chrome as Browser. But after having packaged a native android app, the item is still visible after having deleted it although the item was actually deleted!

    Any ideas why the auto-refresh works in Chrome but not in Android?

    Thanks and regards,
    Peter

  2. Hi Peter,

    Finally I got It.

    For an unknown reason Android doesn't sync the store in the correct way.

    So I've put a listener in PullRefresh's plugin configuration. See the code below:

    Code:
                    plugins: [
                        {
                        	id: 'wf-pullrefresh',
                            xclass: 'Ext.plugin.PullRefresh',
                            tplWriteMode: 'overwrite',
                            listeners: {
                              latestfetched: function(eOpts){
                                console.log("latestFetched"); 
                                var store = Ext.getStore("Worklist");
                                console.log(store.data);
                                store.load();
                              }
                            }
                        }
                    ],
    Hope It helps.

    Regards,
    Fabio Purcino

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,399
    Answers
    3549
    Vote Rating
    849
    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


    Is the list hidden when you delete the record?
    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.

  4. #3
    Sencha User
    Join Date
    Apr 2013
    Posts
    22
    Answers
    1
    Vote Rating
    0
    montalbano is on a distinguished road

      0  

    Default


    No, the list is not hidden...

    One more thing I have observed: The described behaviour only happens if the last item of the list is deleted! As long as there are still entries in the list (i.e. store) everything works fine. But the last item of the store does not disappear from the list...

  5. #4
    Sencha User fabiopurcino's Avatar
    Join Date
    Jul 2013
    Posts
    2
    Answers
    2
    Vote Rating
    0
    fabiopurcino is on a distinguished road

      0  

    Default


    Hi,

    Have you solved the problem? I'm facing the same issue.

    Thanks,
    Fabio Purcino

  6. #5
    Sencha User
    Join Date
    Apr 2013
    Posts
    22
    Answers
    1
    Vote Rating
    0
    montalbano is on a distinguished road

      0  

    Default


    No, unfortunately not, the issue is still open...
    Good luck ;-)

  7. #6
    Sencha User fabiopurcino's Avatar
    Join Date
    Jul 2013
    Posts
    2
    Answers
    2
    Vote Rating
    0
    fabiopurcino is on a distinguished road

      0  

    Default


    Hi Peter,

    Finally I got It.

    For an unknown reason Android doesn't sync the store in the correct way.

    So I've put a listener in PullRefresh's plugin configuration. See the code below:

    Code:
                    plugins: [
                        {
                        	id: 'wf-pullrefresh',
                            xclass: 'Ext.plugin.PullRefresh',
                            tplWriteMode: 'overwrite',
                            listeners: {
                              latestfetched: function(eOpts){
                                console.log("latestFetched"); 
                                var store = Ext.getStore("Worklist");
                                console.log(store.data);
                                store.load();
                              }
                            }
                        }
                    ],
    Hope It helps.

    Regards,
    Fabio Purcino

  8. #7
    Sencha User
    Join Date
    Apr 2013
    Posts
    22
    Answers
    1
    Vote Rating
    0
    montalbano is on a distinguished road

      0  

    Default


    Hi Fabio,

    Thanks for your help. Unfortunately, the event 'lastestfetched' does not get called after having deleted the last record of my store...

  9. #8
    Sencha User pcr's Avatar
    Join Date
    Jun 2009
    Posts
    183
    Vote Rating
    2
    pcr is on a distinguished road

      0  

    Default same problem here

    same problem here


    Me too. After delete the last record in a store. The list shows 1 item with some record. This happens only in android package. In Chrome alls is working fine.

    If tried a lot of options without success. If I log store.getCount() I see the store is really empty.

    This happens only after removing the last record.

    For now I have a workaround: I reload the store if the last record is deleted. This is not full-proof because this relies on the backend. If the reponse from backend is slow the sync is not ready. As far as I know there is no callback for a sync().

    What could be the reason this happens only in Android WebChromView. Anybody?????