1. #1
    Sencha User
    Join Date
    May 2011
    Posts
    48
    Vote Rating
    1
    teedev is on a distinguished road

      0  

    Default How to add a default listener to a FieldSet?

    How to add a default listener to a FieldSet?


    I have a FieldSet which looks like this:

    PHP Code:
    var myFieldSet = new Ext.form.FieldSet;
    myFieldSet.title 'Title goes here';
    myFieldSet.defaults = {
      
    labelWidth '35%',
      
    listeners : {
        
    el : {
          
    click : function(ctl) {alert('hello')}
         },
         
    delegate "input"
      
    }
     }; 
    It works. But I want to add a click listener later per code. It should look like this:

    PHP Code:
    var myFieldSet = new Ext.form.FieldSet;
    myFieldSet.title 'Title goes here';
    myFieldSet.defaults = {
      
    labelWidth '35%'
    };  

    ....
    more code....

    myFieldSet.defaults.addListener('click', function() {
      
    alert('hello');
    }); 
    This dosn't work. The event isn't fired. Please help me. Thanks!

  2. #2
    Sencha User
    Join Date
    May 2011
    Posts
    48
    Vote Rating
    1
    teedev is on a distinguished road

      0  

    Default


    Any ideas? Thx!