1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    55
    Vote Rating
    0
    srxx123 is on a distinguished road

      0  

    Default Working with multiple controllers

    Working with multiple controllers


    Hi,
    I have an application with 2 controllers. THe main controller and a second which shall manage a ChangePassword view.

    The ChangePassword controller has a funtion show which shows the ChangePassword window - the view.

    this.getController('ChangePassword').show();

    This works fine. The problem is that onChangePasswordButtonClick is never called when I click the button. I think I have done something wrong with the controller or the view or both. What's the problem here?

    Code:
    Ext.define('Foo.controller.ChangePassword', {
      extend: 'Ext.app.Controller',
    
      views: [
        'ChangePassword'
      ],
    
    
      onChangePasswordButtonClick: function(button, e, options) {
        alert('M');
      },
    
      show: function() {
        this.v.show();
      },
    
      init: function(application) {
        this.control({
          "button[id='btnChangePassword']": {
            click: this.onChangePasswordButtonClick
          }
        });
        this.v = this.getChangePasswordView().create();
      }
    
    });

  2. #2
    Sencha User
    Join Date
    Jul 2012
    Posts
    55
    Vote Rating
    0
    srxx123 is on a distinguished road

      0  

    Default


    Damned, the selector was simply wrong, it was not id, but itemId...