1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    45
    Answers
    2
    Vote Rating
    0
    cooperka is on a distinguished road

      0  

    Default Answered: Loading a store doesn't update the DataView

    Answered: Loading a store doesn't update the DataView


    I have a simple app (attached below) that loads data from a local Json file into a store and displays it in a DataView. When you press the 'Refresh' button it changes the store URL to a different local Json file and loads the store again. However, the DataView does not refresh like it's supposed to. Am I doing something wrong?

    Button tap event:
    Code:
    var store = Ext.StoreMgr.get('MyJsonStore');
    
    store.getProxy().url = 'item2.json';
    console.log(store.getProxy().url);
    
    store.load();
    Json store:
    Code:
    Ext.define('MyApp.store.MyJsonStore', {
        extend: 'Ext.data.Store',
        requires: [
            'MyApp.model.MyModel'
        ],
    
        config: {
            autoLoad: true,
            model: 'MyApp.model.MyModel',
            storeId: 'MyJsonStore',
            proxy: {
                type: 'ajax',
                url: 'item1.json',
                reader: {
                    type: 'json',
                    rootProperty: 'venueInfo'
                }
            }
        }
    });
    storeRefresh.xda
    storeRefresh.zip

  2. Code:
    var store = Ext.StoreMgr.get('MyJsonStore');
    
    // store.getProxy().url = 'item2.json';
    store.getProxy().setUrl('item2.json');
    store.load();

  3. #2
    Sencha User
    Join Date
    Apr 2012
    Location
    Toronto, Canada
    Posts
    92
    Answers
    20
    Vote Rating
    12
    iSmartDevice is on a distinguished road

      0  

    Default


    Code:
    var store = Ext.StoreMgr.get('MyJsonStore');
    
    // store.getProxy().url = 'item2.json';
    store.getProxy().setUrl('item2.json');
    store.load();

  4. #3
    Sencha User
    Join Date
    Jun 2012
    Posts
    45
    Answers
    2
    Vote Rating
    0
    cooperka is on a distinguished road

      0  

    Default


    Wonderful thank you!

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar