Results 1 to 2 of 2

Thread: Firing non custom events - work arround

  1. #1
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,528
    Vote Rating
    353
      0  

    Default Firing non custom events - work arround

    I'm starting a new project in which I need my custom component called "TriggerFieldClick" which fires "triggerclick" event. Since SD currently doesn't allows to register non custom events in controllers, the work arround is to call again controller's control() method in init() after SD generated code:

    Code:
        onButtonClick: function(button, e, options) {
            alert("Click!");
        },
    
    
        init: function() {
            this.control({
                "mywindow #mybutton": {
                    click: this.onButtonClick
                }
            });
            // Non custom events...
            this.control({
                "mywindow #mytrigger": {
                    "triggerclick": this.triggerTest
                }
            });
        },
    
    
        triggerTest: function(e) {
            alert("Funcion !");
        }
    I checked Controller, Application adn EventBus code to ensure that control() doesn't clear previos registered listeners.

    Regards.
    UI: Sencha Architect 3.x / ExtJS 4 - 6
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: Glassfish / WildFly
    Databases: Oracle / DB2 / MySQL / Firebird

    If you like my answer please vote!

  2. #2
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,487
    Vote Rating
    146
      0  

    Default

    This shouldn't be a problem and is an acceptable workaround in the interim.
    Aaron Conran
    @aconran

Posting Permissions

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