Hybrid View

  1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    5
    Vote Rating
    0
    Miskah is on a distinguished road

      0  

    Default Unanswered: Refresh list no working

    Unanswered: Refresh list no working


    Hi All,
    I know, this question have been asked a thousand times, but i never found my solution.
    There is it.


    I have a simple Store
    Code:
    Ext.define('MyApp.store.Clubs', {
        extend: 'Ext.data.Store',
        alias: 'store.Clubs',
    
    
    
    
        requires: [
            'MyApp.model.Clubs'
        ],
    
    
    
    
        config: {
            groupDir: 'DESC',
            model: 'MyApp.model.Clubs',
            storeId: 'Clubs',
            proxy: {
                type: 'jsonp',
                extraParams: {
                    
                },
                url: 'http://www.myurl.com/mobile/clubs.php',
                reader: {
                    type: 'json',
                    rootProperty: 'datas',
                    totalProperty: 'totalresults'
                }
            },
            grouper: {
                groupFn: function(record) {
                    return record.data.LMmember == 1 ? 'Clubs LESMILLS Members' : 'Clubs LESMILLS';
                }
            }
        }
    });
    
    
    
    
     FavorisClubsStorage = Ext.create('MyApp.store.Clubs', {
            alias : 'MyApp.store.FavorisClubsStorage',
            storeId: 'FavorisClubsStorage'
        });
        FavorisClubsStorage.setAutoSync( true );
        FavorisClubsStorage.getProxy().setNoCache( true );
        FavorisClubsStorage.getProxy().setExtraParams(params);

    I assign store to a dataview.List, like this :
    Code:
        myDataListView.setStore("FavorisClubsStorage");
    And i remove a data :
    Code:
    FavorisClubsStorage.remove(record);
    myDataListView.refresh();
    And my problem, in myDataListView, record is still here. I try to remove it in different way since few hours, but no way. Someone have an idea ?

    Thanks

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    34,118
    Vote Rating
    453
    Answers
    3160
    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


    This simple testcase is refreshing the list on it's own:

    Code:
    var store = new Ext.data.Store({
        fields : ['foo'],
        data   : [
            { foo : 'One'   },
            { foo : 'Two'   },
            { foo : 'Three' },
            { foo : 'Four'  },
            { foo : 'Five'  }
        ]
    });
    
    var list = Ext.Viewport.add({
        xtype     : 'list',
        itemTpl   : '{foo}',
        listeners : {
            itemtap : function(list, idx, listItem, record) {
                var store = list.getStore();
    
                store.remove(record);
            }
        }
    });
    
    list.setStore(store);
    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.