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.
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()>0){
addComponents.add();
addComponents.populateComponents();
}
});
},
I am mostly focused on this main line:
$(this).parent().parent().parent().addClass("editing").find('input, select').removeAttr("readonly").css("background-color","white");
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.
Thanks in advance!
A closer look at the debugger indicated that it was in face changing but was being changed back to it original state further on in the code because of a copy paste error. Can’t image who would have done that. 🙂
Lesson learning, the debugger is your friend.