I have a View called User.js and i have a button in it.
...
buttons: [{
text: 'Reset',
id:'button'
}
...
Now i have my Controller named User.js , and i need to display a console.log message when the user clicks on the Button. The console message should be printed from the controller. My controller code is as follows;
Ext.define('Tangle.controller.User', {
extend: 'Ext.app.Controller',
init: function() {
console.log('works ');
this.control({
'button': {
click: this.refresbut
}
});
},
refreshbut: function() {
console.log('button clicked ');
}
});
According to this nothing hapense the console message is not printed. Can someone look into this please ??
CODE
Ext.define('Tangle.view.user.User' ,{
extend: 'Ext.form.Panel',
items: [{
xtype: 'textfield',
fieldLabel: 'Name',
name: 'name'
}],
buttons: [{
text: 'Submit',
id:'button',
name:'button'
}]
});
As discussed in the comments. You have forgotten to include the controller in your app.