I know that init() executes before the application launch function is called. But I have some code that should be rendered only after the whole application has been launched. Please guide me with this. I need to write it in controller class of my MVC architecture application.
Ext.define('MyApp.controller.Main', {
extend: 'Ext.app.Controller',
models: [
'Leave'
],
stores: [
'MyJsonStore'
],
views: [
'Login',
'MyViewport',
'ManageColumn'
],
init:function(){
this.control({
'managecolumn':{
afterrender:this.allowEdit
}
});
},
allowEdit:function(){
console.log(Ext.get('edit'));
}
});
I am getting null for Ext.get('edit') but when I enter same command in console
I get a positive response.
Without knowing exactly what ‘edit’ element is and how it is set – it is difficult to give you a precise answer.
However, take a look at this MVC example that uses launch function on the Application class http://jsfiddle.net/dbrin/wULET/
The viewport is created on
launch, and you could potentially do what you are looking for.