Results 1 to 3 of 3

Thread: combobox's setValue fires change event endlessly and causing maximum call stack error

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User SurenderBhyan1's Avatar
    Join Date
    Nov 2013
    Location
    INDIA
    Posts
    130

    Default combobox's setValue fires change event endlessly and causing maximum call stack error

    I am not sure if I am creating a duplicate thread for it, if it is please update accordingly.

    ExtJS version
    : 5.1.0 and 5.1.0+

    Browser: any browser

    Description:
    combobox's setValue fires change event endlessly and causing maximum call stack error

    I am using a multiselect combobox and using a change event too where I am setting its value back to it with sorting. This calls the change event again and again and browser got maximum call stack js error and browser becomes unresponsive during this.

    Code:
     
    listeners: {    
    	change: function(combo, newValue, oldValue,e){
    		this.setValue(newValue.sort());  // This is causing endless loop
    	}
    }
    This is working fine till version 5.0, in all above version this is causing error.

    Fiddle:
    https://fiddle.sencha.com/#view/editor&fiddle/21qq

    bug.png

    ---A ship in the harbor is safe, but that is not what the ships are made for...

  2. #2
    Sencha Premium User
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    2,425

    Default

    Can you suspend the change event while re-setting the new value to prevent the loop:

    this.suspendEvent('change');
    this.setValue(newValue.sort());
    this.resumeEvent('change');

  3. #3
    Sencha User SurenderBhyan1's Avatar
    Join Date
    Nov 2013
    Location
    INDIA
    Posts
    130

    Default

    Quote Originally Posted by LesJ View Post
    Can you suspend the change event while re-setting the new value to prevent the loop:

    this.suspendEvent('change');
    this.setValue(newValue.sort());
    this.resumeEvent('change');

    Hi LesJ,

    It stops the endless loop but requirement is not achieved at all.

    I select values in this order BBBB, CCCC, AAAA and combo still showing same order (instead it should show AAAA,BBBB,CCCC).

    Sorting is not applied

    I have updated fiddle with your suggestions, please verify.

    I agree setValue fires the change event fine. but I believe its a BUG, why user bother about handling this by himself to stop this endless loop.
    ---A ship in the harbor is safe, but that is not what the ships are made for...

Similar Threads

  1. Replies: 5
    Last Post: 3 Apr 2017, 12:32 PM
  2. Replies: 1
    Last Post: 25 Jun 2014, 8:39 AM
  3. About the maximum call size stack exceeded error
    By margafred in forum Sencha Touch 2.x: Q&A
    Replies: 5
    Last Post: 5 Jun 2013, 9:08 PM
  4. [FIXED] Unexpected error - Maximum call stack size exceeded
    By lorezyra in forum Ext Designer: Bugs
    Replies: 5
    Last Post: 20 Sep 2011, 5:24 PM

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
  •