below is my code for controller class
Code:
Ext.define('MyApp.controller.Main', {
extend: 'Ext.app.Controller',
models: [
'Leave'
],
stores: [
'MyJsonStore'
],
views: [
'Login',
'MyViewport',
'ManageColumn'
],
onLaunch:function(){
Ext.get('edit').on('click',function(){
console.log('clicked');
});
},
allowEdit:function(){
console.log('hello');
}
});
the onLaunch is not working as expected,
i get the following error
Cannot call method 'on' of null
the documentation states that it is called after the launch function of application is executed. But the click event is not getting attached to my element.
once i go to my browser and type Ext.get('edit')
i get a object to which i can attach click event easily,
where am i wrong?? please help