Results 1 to 2 of 2

Thread: EXT JS 4 MVC - call from controller a click event on a div

  1. #1
    Sencha User
    Join Date
    Feb 2012
    Vote Rating

    Default Unanswered: EXT JS 4 MVC - call from controller a click event on a div

    I was wondering if it's possible to catch a click event on a certain div from the controller in an EXT JS 4 MVC app.
    Lets say we have:

    Ext.define('MyApp.controller.myController', {
    extend : '',
    init : function() {
    '#myDiv' : {
    event: this.myFunction
    myFunction: function() {...} });
    Wneh i click on myDiv i want to call myFunction. Thank you.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


    The control method will only be able to listen to events on controllers not elements. The way I usually do is have the listener within the component and then fire a custom event on the component so that the controller can then listen to it.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2

    Think my support is good? Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts