Skip to content

Instantly share code, notes, and snippets.

@mikekunze
Created January 5, 2012 02:55
Show Gist options
  • Save mikekunze/1563492 to your computer and use it in GitHub Desktop.
Save mikekunze/1563492 to your computer and use it in GitHub Desktop.
extjs login controller
Ext.define('bang.controller.login', {
extend: 'Ext.app.Controller',
views: ['loginPanel'],
init: function() {
remotejs.logMessage('[Client] - Initialized login controller');
this.control({
'loginPanel button[action=login]': {
click: function(button) {
var win = button.up('window'),
form = win.down('form');
form.submit({
success: function(button) {
win.close();
remotejs.logMessage('[Client] - ' + form.getValues().username + ' has logged in, loading interface');
}
});
}
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment