I have a proxy store that fills through two different ways - either via loadData
, or via load
.
I have certain actions that should take place once the store is filled; namely, a certain record should be searched and selected:
preselectByName:function(name, groupName) {
var store = this;
if(store.preselected) return;
store.preselected = true;
store.on('load',function() {
store.selectByName(name, groupName);
store.preselected = false;
},store,{single:true});
}
called like this:
if(store.isLoaded) store.selectByName(name, groupName);
else store.preselectByName(name, groupName);
This code works fine if the store fills via load
, but not via loadData
.
- Is there another event that is fired from both
load
andloadRecord
? - How else would I implement a listener that fires on any of the two events, whichever comes first?