1. #1
    Sencha Premium Member
    Join Date
    Apr 2012
    Location
    Lausanne, Switzerland
    Posts
    196
    Vote Rating
    2
    mcbl can only hope to improve

      0  

    Question Call controllers functions, but how?

    Call controllers functions, but how?


    I have an App called APP,
    a controller called loginController and
    a controller's function called doLogin().

    How to call that doLogin() function when needed? For example in a button tap action, in controller.

    I tried with something like this, without success:
    APP.controller.loginController.doLogin();

    How to call ANY function in a controller?

  2. #2
    Sencha Premium Member
    Join Date
    Apr 2012
    Location
    Lausanne, Switzerland
    Posts
    196
    Vote Rating
    2
    mcbl can only hope to improve

      0  

    Default


    Need your help!

  3. #3
    Sencha User
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    996
    Vote Rating
    49
    ssamayoa has a spectacular aura about ssamayoa has a spectacular aura about ssamayoa has a spectacular aura about

      0  

    Default


    Controllers get events from components.

    So, doLogin() method should be triggered by some action like button click.

    Add a button to your view then add a controller action to your controller which routes click event of that button to the doLogin().

    May be you need to learn a little bit about ExtJS / Touch...
    UI: Sencha Architect 2.x / ExtJS 4 MVC
    Server side: EJB 3.1 / CDI / JPA 2 / JAX-RS / JasperReports
    Application Server: Glassfish 3.1.x
    Databases: Oracle 10g & 11g / DB2 9 & 10 / Firebird 2.5

    If you like my answer please vote!