Search code examples
javascriptextjscomboboxextjs4

ExtJS4 Transform Combobox onchange() event doesn't work


I have a transform ComboBox in extjs4:

<script>   

Ext.onReady(function() {
        Ext.tip.QuickTipManager.init();

        var transformed = Ext.create('Ext.form.field.ComboBox', {
            typeAhead: true,
            transform: 'DisplayListID',
            forceSelection: true
        });
    });
  </script>



 <select  id="DisplayListID" onChange="change();">
      <option> ...

    </select>

ExtJS successfully transform my HTML select into a ComboBox but when I select an element, the onChange event is not fired.

How can I bind the javascript function change() to my transform CombBox?


Solution

  • Use a ExtJs change event by adding a listener to the combobox :

    listeners: {
        change: change
    }
    

    where the second change is your function.