1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    1
    Vote Rating
    0
    aagrawal is on a distinguished road

      0  

    Default Cannot find triggerClick event on Trigger field

    Cannot find triggerClick event on Trigger field


    I am using sencha architect, I added a trigger field but I cannot find the click event so that I can do something when some one clicks on the lookup.

  2. #2
    Sencha User
    Join Date
    Jun 2011
    Posts
    350
    Vote Rating
    1
    bharatn is on a distinguished road

      0  

    Default


    You are right. Since its not a standard function this was overlooked.

    You can add a basic function (call it onTriggerClick) to the TriggerField. Or you can add a custom property - type 'onTriggerClick: function() {}' in the search field and click Add. Then you can click on + sign in the custom field row to define the function.
    Bharat Nagwani
    Sencha Designer Development Team

  3. #3
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,310
    Vote Rating
    112
    ssamayoa is just really nice ssamayoa is just really nice ssamayoa is just really nice ssamayoa is just really nice ssamayoa is just really nice

      0  

    Default


    onTriggerClick (as Bharat said):

    Code:
    var me = this;
    if (!me.hideTrigger) {
        me.fireEvent("triggerclick", me, event);
    }
    In init() method of your controller add this (after generated code):

    Code:
            // Non custom events...
            this.control({
                "mywindow #mytrigger": {
                    "triggerclick": this.triggerTest
                }
            });
    Replace the component query with your own.

    triggerTest:

    Code:
        triggerTest: function(e) {
            alert("works !");
        }
    Regards.
    UI: Sencha Architect 3.x / ExtJS 4 & 5
    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!

Thread Participants: 2