Hi I have button on click of which i need to load a view with a grid. This view is bound to a viewModel which has an ajax proxy store. I have a ajax proxy defined using an API. But this API is dynamically set on the controller using the below code.

Code:
store.getProxy().url = "someDynamicUrl";
store.load();
If i use this, i get an error like 'Cannot read property 'getProxy' of undefined'. It seems like the store is not yet initialised and am trying to set its proxy.

The same above code works if deferred for some seconds. as below

Code:
Ext.defer(function(){
store.getProxy().url = 'someDynamicUrl';
store.load();
}, 1000)
It clearly means that my store is not initialised when the controller's initialise function is called. Can someone please tell me how to proceed with this?