Results 1 to 4 of 4

Thread: ComboBox suspendEvents doesn't work

    This issue duplicates another issue.
  1. #1
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    66
    Vote Rating
    1
      0  

    Default ComboBox suspendEvents doesn't work

    Ext version tested:
    • Ext 4.1.1-rc2

    Browser versions tested against:
    • FF14

    Description:
    • I am trying to suspend the events of a combobox, set a value in that combobox and resumeevents afterwards

    Steps to reproduce the problem:
    • Create a combobox
    • Add an xtype selector listener in a controller
    • 'mycombobox':{change:mychangefunction}

    The result that was expected:
    • that it wouldnt fire mychangefunction()

    The result that occurs instead:
    • it still fires mychangefunction()

    Code:

    I have an array of comboboxes that I obtained by using .query() on a panel. Then I iterate the through them and set a value in each.

    Code:
    console.info("silent", silent, typeof silent == "boolean")
            
            if(optionsStore && views && viewSelectors){
                
                for(var i = 0, l = viewSelectors.length; i < l; i++){
                    
                    var viewRecord = optionsStore.findRecord("portal", views[i]);
                    
                    if(silent){
                        viewSelectors[i].suspendEvents();
                    }
                    
                    console.info("viewSelectors[i]", viewSelectors[i], viewSelectors[i].eventsSuspended);
                    viewSelectors[i].setValue(viewRecord);    
                    console.info("viewSelectors[i]", viewSelectors[i], viewSelectors[i].eventsSuspended);
                    
                    if(silent){
                        viewSelectors[i].resumeEvents();
                    }
                }
                
            }    
            
            console.info("silent", silent, typeof silent == "boolean")
    The console with viewSelectors[i].eventsSuspended = 1
    Set the change events of viewSelectors[i].setValue(viewRecord);
    are still fired.

    Thanks in advance

  2. #2
    Sencha Premium User
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,887
    Vote Rating
    541
      1  

    Default

    I believe this might be a duplicate bug report, see this

  3. #3
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    66
    Vote Rating
    1
      0  

    Default

    looks like your right - thanks

  4. #4
    Ext JS Premium Member devtig's Avatar
    Join Date
    Jan 2010
    Location
    Rotterdam, The Netherlands
    Posts
    419
    Vote Rating
    14
      0  

    Default

    I found a solution for comboboxes. It doesn't fix it in the core, but at least you get your trigger to not fire.

    Code:
    mycombobox.suspendCheckChange++;
    mycombobox.setValue(value);
    mycombobox.suspendCheckChange--;
    Christiaan Westerbeek @ Devotis
    Contact me for help with Ext JS, Node JS, FireBase, AngularJS and Javascript in general. Email me or find me at AirPair to connect.

Tags for this Thread

Posting Permissions

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