PDA

View Full Version : Launch function



bstras21
18 Nov 2011, 7:27 PM
Hello, I am trying to reference one of my stores in my controller and it seems it's not loading at the time of the call. I am using


console.log(Ext.getStore('MyStore').count());

but the result is 0

If I tie it to a button handler an click it I get 10, so this is telling me it is not loaded yet in the controller. I looked at the docs and it seem there is a launch function that executes after the application, however this code does not run, any thought on how to access my store?



Ext.define('tapp.controller.MyController', {
extend: 'Ext.app.Controller',
views: ['MyApp'],
stores: ['MyStore'],
launch: function (){
console.log('LLLLAAAUNCHEDDDD');
},

bstras21
18 Nov 2011, 8:01 PM
Here is the function I used:



punchStore = this.getMyStoreStore();

punchStore.load({
scope : this,
callback: function(records, operation, success) {
console.log(records);

}
});