1. #1
    Sencha User
    Join Date
    Aug 2007
    Location
    Munich, Germany
    Posts
    135
    Vote Rating
    0
    gelleneu is on a distinguished road

      0  

    Default ComboBox onChange doesn't work?

    ComboBox onChange doesn't work?


    Hello,

    i need help with a combobox inside a Basic Formular..
    The Function in the onChange event will not beCalled.
    If i use the onBlur event, it works fine..

    The Code is:

    Code:
              
    form_produktfamilie = new Ext.form.Form({labelAlign: 'right', labelWidth : 100});
    form_produktfamilie.add ( 
    	  
                  new Ext.form.ComboBox({
                        fieldLabel: 'Produktfamilie',
                        ...
    	            onChange: function(){xajax_neuanlage_selectProdukt(this.getValue()) },
                        ...
                        width:250
                    })				
    	      );

  2. #2
    Sencha User fay's Avatar
    Join Date
    Apr 2007
    Location
    Ireland
    Posts
    1,750
    Vote Rating
    9
    fay will become famous soon enough fay will become famous soon enough

      0  

    Default


    You want to use on.('select'):

    Code:
    form_produktfamilie = new Ext.form.Form({labelAlign: 'right', labelWidth : 100});
    var cbProduktfamilie = new Ext.form.ComboBox({
                        fieldLabel: 'Produktfamilie',
                        ...
                        width:250
    });
    form_produktfamilie.add(cbProduktfamilie); 
    
    cbProduktfamilie.on('select', function(){
      xajax_neuanlage_selectProdukt(cbProduktfamilie.getValue());
    });
    From docs:

    select - Fires when a list item is selected.
    change - Fires just before the field blurs if the field value has changed.

  3. #3
    Sencha User
    Join Date
    Aug 2007
    Location
    Munich, Germany
    Posts
    135
    Vote Rating
    0
    gelleneu is on a distinguished road

      0  

    Default Thanks!

    Thanks!


    Thank you, it works great!

    I used onSelect instead of "onChange" before, and it worked too, but the opened list didn't closed automatically and so on...

    Now it's fine...

Thread Participants: 1