This is not a question, but maybe I can help others with this code.
Since the ExtJS repository is not something like isLoaded (), I override it. But I need time to figure this out and make it work. Here is the code (in the coffee script). Feel free to use it.
By doing this, you can do with any store (associations also):
store.isLoaded
If you want to call a method in the repository, but you need a busy store, you can use
store.invokeWhenLoaded(yourFunction)
The code itself explains (I think :-))
Ext.data.AbstractStore.override(
constructor:(config) ->
Ext.apply(config, {
isLoaded: false
waitlist: []
})
rslt = @callOverridden(arguments)
@on('load', @onLoad)
rslt
processWaitlist:()->
unless @waitlist.isEmpty()
fn() for fn in @waitlist
@waitlist = []
invokeWhenLoaded:(fn)->
if @isLoaded
fn()
else
@waitlist.push(fn)
onLoad:()->
unless @isLoaded
@isLoaded = true
@processWaitlist()
)
source
share