I am have formula and want execute it when store in this viewModel
is changeData
.
When I do this, the formula does not work when data in store changed
stores: {
currentStore: {
extend: 'Ext.store.MyStore',
trackRemoved: false
},
},
formulas: {
'executeWhenStoreChange': {
bind: '{currentStore}',
get: function () {
console.log('store change')
},
If you're looking to fire a function when data changed I would use a datachanged
listener to the store(s) you want the event to fire on.
currentStore: {
listeners: {
datachanged: function(store, eOpts) {
console.log('store change');
}
}
},
If you want it for all stores just reference the function in each datachanged
listener
currentStoreA: {
listeners: {
datachanged: 'onStoreDataChangeD'
}
},
currentStoreB: {
listeners: {
datachanged: 'onStoreDataChangeD'
}
},
Then in the view controller:
onStoreDataChangeD: function(store, eOpts) {
console.log('store changed');
}