dimanche 8 juin 2014

How to do something like 'up' from form success handler?

Newbie alert.

I am trying to write a authentication system using card layout. On successful submission of credentials, I want the success handler of my login form to do layout.setActiveItem('authenticated'). But, I have to be able to get the layout object.


I have tried a couple of things but nothing in the scope of the success handler seems to be able to access the component hierarchy. How is this meant to be done?



Code:



buttons: ['->', { text: 'Login',
handler: function() {
var frmLogin = this.up('form').getForm();
if (frmLogin.isValid()) {
frmLogin.submit({
url: '/user/session',
waitMsg: 'Submitting your credentials',
success: function(form, action) {
var panel = form.up('panel'); //form doesn't have an up method?




Aucun commentaire:

Enregistrer un commentaire