Results 1 to 4 of 4

Thread: Suspend all events throughout form in one go

  1. #1

    Default Suspend all events throughout form in one go

    I have a form with several fields. Each fields has a listener with a handler to update the loaded record instantly when a field has changed. These events also trigger when a new record is loaded, what should be suppressed. I can of course find all listeners on the fields in the form and use suspendEvents on all, but my question is: is there a more simple way to "bubble down" a suspendEvents thoughout a form ?

  2. #2
    Sencha Premium User dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    1,255
    Answers
    27

    Default

    this could help with your loading issue:

    Code:
    var basic = form.getForm();
    basic.getFields().each(function(item, index, length){
      item.suspendCheckChange++;
    });
    
    basic.loadRecord(myRecord);
    
    basic.getFields().each(function(item, index, length){
      item.suspendCheckChange--;
     }); 
    http://extjs-tutorials.blogspot.com/...le-events.html
    Cloud Application Architect

    Sencha Specialist / Sencha MVP / Sencha Technical Trainer
    ExtJs Developer + Contributor since 0.2.2 - Champion of the per developer license.

  3. #3

    Default

    @dawesi : Nice one ! I'll just replace suspendCheckChange with suspendEvents(false), since not all fields have the same event to listen to (e.g. checkbox, combobox l). But it works.

  4. #4
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    +1 on suspendEvents since suspendCheckChange is a PRIVATE property which should then be avoided when something else that is public.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

Similar Threads

  1. Replies: 1
    Last Post: 21 Mar 2012, 6:51 AM
  2. Suspend/resume events help
    By drian in forum Ext 3.x: Help & Discussion
    Replies: 4
    Last Post: 2 Jun 2011, 5:53 AM
  3. Cant suspend events
    By defcon1 in forum Ext 3.x: Bugs
    Replies: 2
    Last Post: 21 Apr 2011, 1:44 AM
  4. Cant suspend events
    By defcon1 in forum Ext 3.x: Help & Discussion
    Replies: 5
    Last Post: 5 Apr 2011, 12:10 AM

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
  •