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
.
load
and loadRecord
?datachanged
(http://docs.sencha.com/extjs/6.2.1/classic/Ext.data.Store.html#event-datachanged)is an event, that fires from both load
and loadRecord
, but be careful, it fires from any change that made to the dataset.
Besides: I usually use this to find the event that I need in ExtJs:
Ext.util.Observable.capture(myObj, function(evname) {console.log(evname, arguments);})
It captures all ExtJs events, fired by the myObj
component and logs it to the console.
load
and after loadData
, like:store.on("load",function(){store.fireEvent("myload")})
and
store.loadData(...)
store.fireEvent("myload")
then
store.on("myload",function(){...})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With