[CLOSED] Client side change component handler function....

  1. #1

    [CLOSED] Client side change component handler function....

    Hi,
    I have a client side script that is looking for components. Once found, I want to update the "blur" handler javascript function for that handler. These are numberfields, and I want to update the blue function to pass new id's back to server..

    
     for(var x=0;data.length;x++)
                    { 
                        var c =   Ext.getCmp('Control_'+data[x].PortfolioPerformanceTitleId);
                        c.addListener(
                            "blur", 
                             function () {
                                 alert("State changed");
                             }
                        );
                    }
    However, this doesn't seem to work. The old handler is still being called. How can I do this?
    Last edited by Daniil; Jul 27, 2012 at 2:09 PM. Reason: [CLOSED]
  2. #2
    Hi,

    The addListener method doesn't remove any previously attached listeners. It just adds a new one.

    So, you should remove a previous one using the removeListener method or its shorthand "un".
    http://docs.sencha.com/ext-js/3-4/#!/api/Ext.util.Observable-method-removeListener

Similar Threads

  1. Replies: 17
    Last Post: Dec 29, 2012, 6:25 AM
  2. [CLOSED] Client-side component status
    By thchuong in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 09, 2012, 4:59 PM
  3. [CLOSED] How to change theme from the client side
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Jul 19, 2012, 7:49 PM
  4. Replies: 3
    Last Post: Dec 26, 2011, 1:32 PM
  5. [CLOSED] Change fieldLabel on client-side
    By Pablo_Azevedo in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 28, 2010, 5:18 PM

Posting Permissions