I have a problem with the control that I create that contains a table where the body scrolls. Lines have a click () function handler, for example:
$('.innerTable tr').click (function (e) {
if (event.target.nodeName == 'DIV' ||
event.target.nodeName == 'TD' ) {
if (e.ctrlKey == false) {
$('.innerTable tr').removeClass ('selected');
}
$(this).toggleClass ('selected');
}
});
There is a button that adds rows to the table, for example:
$('#innerTable > tbody:last').append('<tr>...some information...</tr>');
While the ARE lines have been successfully added, for some reason, the static lines work with the click handler, but not in the new lines added. Is something missing?
source
share