1. #1
    Sencha User
    Join Date
    Nov 2012
    Location
    Cali, Colombia
    Posts
    16
    Vote Rating
    2
    csantos is on a distinguished road

      0  

    Default Unanswered: Listener event to two or more functions

    Unanswered: Listener event to two or more functions


    Hi community,
    I have a problem,
    I need define inside of Controller, a event for listeners two functions and this not work.

    The source is:

    Code:
    Ext.define('myProyect.controller.FormController', {
        extend: 'Ext.app.Controller',
        config: {
            refs: {
                 fieldid : 'textfield[id=fieldid]'
            },
            control: {
                fieldid : {
                      change : ['ChangeValue', 'ChangeValue2']
                }
            }
        },
        ChangeValue : function(me, newValue, oldValue){
            console.debug(me);
        },
        ChangeValue2 : function(me, newValue, oldValue){
            console.debug('2', me);
        }
    });
    How to configure the property 'control'??

    Thanks for all

  2. #2
    Sencha User
    Join Date
    Mar 2011
    Posts
    83
    Vote Rating
    11
    Answers
    16
    Schildi will become famous soon enough

      0  

    Default


    Hi csantos,

    can't you do this like this?
    Code:
    Ext.define('myProyect.controller.FormController', {
        extend: 'Ext.app.Controller',
        config: {
            refs: {
                 fieldid : 'textfield[id=fieldid]'
            },
            control: {
                fieldid : {
                      change : 'handleFieldChange'
                }
            }
        },
        handleFieldChange: function(textfield, newValue, oldValue) {
            this.ChangeValue(textfield, newValue, oldValue);
            this.ChangeValue2(textfield, newValue, oldValue);
        },
        ChangeValue : function(me, newValue, oldValue){
            console.debug(me);
        },
        ChangeValue2 : function(me, newValue, oldValue){
            console.debug('2', me);
        }
    });
    Best regards,
    Schildi

  3. #3
    Sencha User
    Join Date
    Nov 2012
    Location
    Cali, Colombia
    Posts
    16
    Vote Rating
    2
    csantos is on a distinguished road

      0  

    Default


    Thanks for your help Schildi,
    With that solved my problem.

Thread Participants: 1

Tags for this Thread