Jquery event binding won't work when called as a method but will when called directly in console
<p>I have a maddening problem. I have a table that contains rows consisiting of text inputs and selects. I have custom method I have definied that when called in the code, or in the console, it does not bind the click event any of the selects. Only the text inputs. However, if I copy and paste the code of the method directly in the console, it works just fine. Below is my code.</p>

<pre><code>addEditHandler : function(){
                    $('#table2 .ui-icon-pencil').click(function(){
                            $(this).parent().parent().parent().addClass("editing").find('input, select').removeAttr("readonly").css("background-color","white");
                            $('#table2 .ui-icon-disk').eq($(this).parent().parent().parent().index()).show();
                            $('#table2 .ui-icon-trash').eq($(this).parent().parent().parent().index()).show();
                            $('#table2 .ui-icon-triangle-2-n-s').eq($(this).parent().parent().parent().index()).show();
                            $('#table2 .ui-icon-pencil').hide();
                            if(addComponents.getCurrentComponents(getBOM.rawXML).size()&gt;0){
                                addComponents.add();
                                addComponents.populateComponents();
                            }

                    });
                },
</code></pre>

<p>I am mostly focused on this main line:</p>

<pre><code> $(this).parent().parent().parent().addClass("editing").find('input, select').removeAttr("readonly").css("background-color","white");
</code></pre>

<p>Calling this method doesn't apply the formatting to the selects, just the text boxes. Copying and pasting the EXACT code into the console does. At a loss.</p>

<p>Thanks in advance! </p>
