Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Ext.form.ComboBox, change Event doesn't work

  1. #1
    Ext User Enrico's Avatar
    Join Date
    Mar 2007
    Location
    Berlin, Germany
    Posts
    17
    Vote Rating
    0
      0  

    Default Ext.form.ComboBox, change Event doesn't work

    Hi Jack,

    following code doesn't work. If I replace "change" by "select" it works perfect.

    Code:
    var customerChangeComboBox = new Ext.form.ComboBox({
        typeAhead: true,
        triggerAction: 'all',
        transform: 'customer_customer_id',
        width: 150,
        forceSelection: true
    });
    customerChangeComboBox.on('change', function(box, record, index) {
      ...
    });

  2. #2
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    6,956
    Vote Rating
    20
      0  

    Default

    change is the browsers change event. It doesn't always fire, which is why select exists.
    Jack Slocum
    Sencha Co-Founder, Ext JS Founder
    Original author of Ext JS 1, 2 & 3.
    Twitter: @jackslocum

  3. #3
    Ext JS Premium Member
    Join Date
    Apr 2007
    Posts
    23
    Vote Rating
    0
      0  

    Default

    Select works great as long as the user is only selecting items from the dropdown, but obviously doesn't fire when the user just edits the text portion. Since the change event also does not fire, how can I detect when the value of the text has been changed? Is there built-in support for this or do I have to roll my own?

  4. #4
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    6,956
    Vote Rating
    20
      0  

    Default

    Quote Originally Posted by RobbyRacoon View Post
    Select works great as long as the user is only selecting items from the dropdown, but obviously doesn't fire when the user just edits the text portion. Since the change event also does not fire, how can I detect when the value of the text has been changed? Is there built-in support for this or do I have to roll my own?
    "change" should fire when the user leaves the field if the text has changed. Is that not the behavior you are seeing?
    Jack Slocum
    Sencha Co-Founder, Ext JS Founder
    Original author of Ext JS 1, 2 & 3.
    Twitter: @jackslocum

  5. #5
    Ext JS Premium Member
    Join Date
    Apr 2007
    Posts
    23
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by jack.slocum View Post
    "change" should fire when the user leaves the field if the text has changed. Is that not the behavior you are seeing?
    Correct, I never see the change event fire. I will post the code I am using when I return to work tomorrow, surely there is a clue there that I am just not seeing.

  6. #6
    Ext User
    Join Date
    May 2007
    Posts
    8
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by Enrico View Post
    Hi Jack,

    following code doesn't work. If I replace "change" by "select" it works perfect.

    Code:
    var customerChangeComboBox = new Ext.form.ComboBox({
        typeAhead: true,
        triggerAction: 'all',
        transform: 'customer_customer_id',
        width: 150,
        forceSelection: true
    });
    customerChangeComboBox.on('change', function(box, record, index) {
      ...
    });

    customerChangeComboBox.on('select', function(box, record, index) {

  7. #7
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    0
      0  

    Default

    It would appear that change is only fired in Field.onBlur, but this is overridden by TriggerField.onBlur

  8. #8
    Ext User
    Join Date
    Aug 2007
    Posts
    2
    Vote Rating
    0
      0  

    Default Is this considered a bug?

    Since it seems that the method was overidden, there was probably a good reason?
    Is this currently considered a bug in version1.1? If so, are there plans to fix it?

    Thank you!

  9. #9
    Ext User
    Join Date
    Mar 2007
    Posts
    89
    Vote Rating
    0
      0  

    Default

    The same for me here. I can't find a way to fire the onchange event on a combobox.
    I think is a bug and it seems to being somehow related with the same kind of bug on datefield which I wrote in this thread http://extjs.com/forum/showthread.php?t=4208

  10. #10
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
      0  

    Default

    this is already fixed in SVN.

    see this post for a temp override (for Ext 1.1 final) till the next release of Ext.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •