1. #1
    Sencha User
    Join Date
    Jun 2009
    Posts
    391
    Vote Rating
    2
    parky128 is on a distinguished road

      0  

    Default store updaterecord event not firing for me

    store updaterecord event not firing for me


    Hi,

    I have encountered a weird problem with a store I am loading some updated records into but the updaterecord event is not firing.

    The store is bound to a list component, and I can see existing rows get updated with amended values correctly, but I also have a listener attached to the store in a controller but it never fires:

    Code:
    Ext.getStore('CurrentGrid').on( { 'updaterecord': function(store, record, newIndex, oldIndex, eOpts) {
                console.log('do something');
            }, scope: this});
    My store is defined like so:
    Code:
    Ext.define('PinpointersTouch.store.CurrentGrid', {
        extend: 'Ext.data.Store',
        requires: [
            'Ext.data.proxy.JsonP',
            'Ext.data.reader.Array',
            'PinpointersTouch.model.CurrentGrid'
        ],
        config: {
            storeId: 'CurrentGrid',
            model: 'PinpointersTouch.model.CurrentGrid',
            proxy: {
                type: 'jsonp',
                noCache: false,
                enablePagingParams: false,
                url: 'MY-URL-HERE',
                reader: {
                    type: 'json',
                    rootProperty: 'data'
                }
            },
            sorters: [{
                property : 'EventDT',
                direction: 'DESC'
            }]
        }
        
    });
    And I am calling load on my store:

    Code:
    Ext.getStore('CurrentGrid').load({addRecords:true});
    I tried a listener on the refresh store event and that does fire, so why wont updaterecord fire? I must be missing something here, but I can't think what.

    Any thoughts out there?
    Thanks

  2. #2
    Sencha User
    Join Date
    Jun 2009
    Posts
    391
    Vote Rating
    2
    parky128 is on a distinguished road

      0  

    Default


    I can only get around this by listening to my store's refresh event which is not great as I dont know which records are my modified ones.

    Is there an issue with using 'addRecords:true' in the config object of the store.load() function?

    The list which is bound to the store is clearly listening for the refresh event to update its store, I guess this is by design.

    So...Whats the recommended approach to preserving existing records in a store and updating the changes to these from a load call so the updaterecord event fires?

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